Get the url from the DOM using js. $('a.do-ajax').click(function(){ var url = $(this).attr('href');
$.post(url, function(data){ //do stuff }); }); On Aug 7, 11:11 am, "Sebastien Armand [Pink]" <khe...@gmail.com> wrote: > Hello everyone, > > I was wondering how to get an environment independent url in javascript > files. My js needs to connect to the server and get some JSON data and > update a form on certain actions. But putting that actions url in the js > directly breaks everything when you change environment... > > I might be missing something here but don't see the light of how to do it, > any insight welcome ;-) -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en