Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><s>why you have <code>'?callback=?'</code> at the end of url ? is it <code>jsonp</code>? yes then change the <code>dataType:'jsonp'</code></p> <p>Edit</p> <p>make a error handler </p> <pre><code>$.ajax({ url: 'localhost:39657/List/' + $(this).val(), dataType: "json", success: function(json) { alert("success"); }, error:function(xhr){ console.log(xhr.responseText); } }); </code></pre> <p>see if it hits the success handler or the error handler and what error message does it give? i dont think there is something wrong with the json parsing as it is valid json and being parsed fine <a href="http://jsfiddle.net/3NCZR/" rel="nofollow"><em>look here</em></a> </s></p> <hr> <p>as infered from the comments you are running into the <a href="http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing" rel="nofollow"><strong>CORS</strong></a> blues, which is implemented as a security feature to prevent cross site scripting attacks you cannot use <code>jsonp</code> by just setting the dataType to jsonp on the client side, the server side has to be configured as well, if its a web-service you can set the response header to allow the cross domain resource sharing by </p> <pre><code>var resp = new HttpResponseMessage(); resp.Headers.Add("Access-Control-Allow-Origin","*"); </code></pre> <p>alternatively you can make a server side <em>proxy</em> and have that proxy call your other project whether its a webservice or web application and then return the received response to the client side </p>
 

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