Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery AJAX, Error Status code: 200, Status Text: parserorro | OK
    primarykey
    data
    text
    <p>Here is a funny situation that I'm in. I'm developing an ASP.Net web site using VS 2008 and .Net Framework 3.5, and I want to use jquery ajax in a test page, the code looks like this: </p> <pre><code>C# Method [WebMethod] public static string test() { return "Server Response" ; } $(document).ready(function() { $("#myDiv").click(function() { $.ajax({ type: "POST", url: "AjaxTest.aspx/test", data: "", contentType: "application/json;charset=utf-8", dataType: "json", success: function(msg) { // Replace the div's content with the page // method's return. alert(msg.d); }, error: function(result){ alert("error occured. Status:" + result.status + ' --Status Text:' + result.statusText + " --Error Result:" + result); } }); }); }); </code></pre> <p>So When I use Jquery 1.4.4 like this : </p> <p>I get : <code>Status 200; Status Text: OK</code></p> <p>When I use Jquery 1.5 I get: <code>Status 200; Status Text: Parsererror</code></p> <p>So I created a new WebSite in Visual Studio, copy and pased the code there, and it works fine !!!! I can't figure out what causes the problem. Also I have used methods with parameter, and setting data:<code>"{}"</code>, and removing data completely, but nothing seems to work.</p> <p>I don't know if has to do anything with the DevExpress components that I'm using or not. </p> <p>I also found a good answer which was working with complete method like this :</p> <pre><code> complete: function(xhr, status) { if (status === 'error' || !xhr.responseText) { alert("Error"); } else { var data = xhr.responseText; alert(data); //... } } </code></pre> <p>But I don't know if it will work fine or there might be some other problem with this method too. I also don't know how to access response data from here. But my main concern is finding out what is causing the problem in my website.</p> <p>UPDATE: Well today in Google Chrome console I noticed some syntax problems with JQuery 1.5 they are as below:</p> <p>Uncaught SyntaxError: Unexpected token &lt; jQuery.jQuery.extend.globalEvaljquery.js:593 jQuery.ajaxSetup.converters.text scriptjquery.js:7175 ajaxConvertjquery.js:7074 donejquery.js:6622 jQuery.ajaxTransport.send.callbackjquery.js:7441</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload