I have a problem with ajaxSubmit ... The problem is that when I submit the form and get a response from PHP that has a script with window.location , the page doesn't change at all ...
My PHP script just returns a script with window.location when the form is submitted correctly, otherwise it returns JSON, which is parsed for a success function.
Using Chrome tools, I see that it loads the window.location URL on the Network tab, but doesnβt show it to the user ...
Here is the code I have:
$("form").submit(function(e) { e.preventDefault(); $("form").ajaxSubmit({ success: function(resp){ try{ resp=JSON.parse(resp); alert(resp["error"]); } catch(e){ $("<div></div>").html(resp); } } }); return false; });
How do I make it work? Is there any property of the options parameter AjaxSubmit that could solve this?
source share