Recursive dialog window and mystery error message
I'm training myself on jQueryMobile and using dialog windows for form submission
The form itself is being submitting via AJAX and when there is a problem with the logon attempt the response kicks in an alert with the error message.
While the submission technically works I'm running into three problems.
The first is that when a user successfully logs on jQueryMobile itself flashes an error dialog momentarily and then proceeds as normal.
The second being that when an error alert is kicked in, the alert appears as intended but the the dialog window opens again on top of itself.
The third is that the first dialog window is blanked out.
Example of what happens with the dialog window recursion:
url/index.php#&ui-state=dialog#&ui-state=dialog&ui-state=dialog
Example of my code:
$(function(){ $("#form").submit(function(e){ e.preventDefault(); var dataString = $("#form").serialize(); $.ajax({ type: "GET", url: "formHandler.php", data: dataString, dataType: "text", success: function(data){ $(".ui-dialog").dialog("close"); location.href="index.php"; }, error:function (xhr, ajaxOptions, thrownError){ alert(thrownError); } }); }); });