Jquery .ajax() Issue January 06, 2023 Post a Comment I am using Jquery 1.7.1 and am having issues.. I'm working with a CRM in my script and am working to get the page finished but I'm stuck with this issue.. my html: Solution 1: Here are some suggestions that might help you find the error: In your ajax call, after the success, add the following code: success: function(response) { alert(response); }, error: function(response) { console.log(response.status + " " + response.statusText); } Copy That will print in your console a clue to what is causing this error. By the way, there are some other suggestions, your validations can be achieved with the new HTML5 input types (email, phone), if you have to maintain compatibility with browsers that don't support these, you can find a jQuery plugin that handles this. Solution 2: Do you make an cross domain ajax request ? I downloaded your code and make a simple test: Code in localhost:8080/domain1/a.php Make a ajax request to localhost:8080/domain2/b.php Error happens Baca JugaHow To Redirect The Request To Specified Php Page By Ajax Call?Jquery - Looping A .load() Inside A 'for' StatementHow To Redirect The Request To Specified Php Page By Ajax Call? Code in localhost:8080/domain1/a.php Make a ajax request to the page itself (localhost:8080/domain1/a.php) No error happens and get the expected response. Then I googled the answer for [jquery.ajax cross domain request],and find some links may helps: jQuery AJAX cross domain Soluation is : dataType: 'JSONP' $.ajax({ url:"testserver.php", dataType: 'JSONP', // Notice! JSONP <-- P success:function(json){ // do stuff with json (in this case an array) alert("Success"); }, error:function(){ alert("Error"); }, }); Copy Solution 3: I'm not sure about using $(this).serialize(). Have you tried using $('.collector').serialize() (or whichever the form is) since inside the ajax request the context may change. It's just a quick guess, hope it helps. Solution 4: The same thing happened to me.And I used the same version of JQuery (1.7.1) And the weirdest thing is that after adding "asyn:false ",it worked out. I guess this might be a bug of JQuery. Share You may like these postsAdding Warning When Button Is DisabledJquery Syntax Error For A Valid JsonWhy Is Click Event Attached To Classname Fired After Classname Is Removed?Use Ajax To Request For Rails Controller Data Post a Comment for "Jquery .ajax() Issue"
Post a Comment for "Jquery .ajax() Issue"