I have a set of sessions in a page, which I want to remove using AJAX. i.e click on a link, and without having to navigate for a new page, just remove the session, and show
In your AJAX call you use global event
object, which is not cross-browser and shouldn't be used (e.g. Firefox doesn't have it).
Pass event in function call instead:
$('#remove_session').click(function(e){
e.preventDefault();
// rest of your code
});
If you do it that way, jQuery takes care about cross-browser normalization and proper behaviour.
See also this question to learn more about difference between global event
object and event passed into function.
If it still doesn't work
GET
is default)dataType: "json"
to your AJAX request, but this shouldn't be a problem as Symfony's JsonResponse
should already provide neccessary response headers Check other places
:
is; investigate that line; is the code you have posted here the whole
javascript that you have on your page?