Reputation: 33644
So I have an ajax call to submit my post without refresh, when I click on the submit button I tried to see what is the error on firebug console, however it goes off the screen very fast and I can't see what the error is. Any idea on what I do? I tried printing to the console and this is gone in a click as well.. I don't know what is going on.
Upvotes: 0
Views: 669
Reputation: 15802
Sounds like your AJAX is failing and throwing an error, and the script just ends up navigating to the new page.
You could remove the href
from the link (or action
from the form
) by setting it to #
, and then pass the AJAX a string with what the link would have been.
I prefer just to click then spam the Esc key, it's far more fun :)
Upvotes: 0
Reputation: 532435
Sounds like it's not doing AJAX at all, but instead doing a normal request. That can happen if you don't prevent the default action in your submit handler. Try returning false from your submit handler (or button click handler, whatever triggers the form post). If that doesn't work, try persisting the network requests in Firebug to see if the AJAX request is even being made.
Upvotes: 2