Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Jsonp: Request failed: parsererror in Internet Explorer 9 and below
    primarykey
    data
    text
    <p>I am using JSONP to make cross domain requests. The script works perfectly in Firefox and Chrome, but in IE 9 and below I get the following error:</p> <pre><code>Request failed: parsererror Error: jQuery1720027601653975035778_1348794800150 was not called </code></pre> <p>I've tried setting the dataType from <code>jsonp</code> to <code>text/json</code> but then it wont work in Chrome or Firefox, and while the call is successful in IE I get a null response.</p> <h3>Code</h3> <pre><code>$.ajax({ // the function that does everything type: "GET", url: "http://example.com/products.php?size=" + search_size + "&amp;manufacturer=" + search_manufacturer + "&amp;gender=" + search_gender + "&amp;instock=Y&amp;startat=0&amp;results=30&amp;callback=?", //&amp;callback=? is required to send the offsite server the data. ? is automatically filled in by AJAX async: true, cache: false, contentType: "text/json; charset=utf-8", dataType: "jsonp", error: function(xhr, textStatus, errorThrown){ // textStatus = Error code if it fails (parsererror = json handshake fail) $(datastatus).empty() ; $(datastatus).append("&lt;b&gt;Request failed: &lt;/b&gt;" + textStatus + "&lt;br&gt;" + errorThrown); // Puts the error code in a special div. }, success: function(data, textStatus){ // data = the json array $(datastatus).empty(); $(datastatus).append("&lt;b&gt;Request succeeded: &lt;/b&gt;" + textStatus); $("#output").empty(); // empties the product list in preperation to be filled alert(data); $.each(data, function(index, value) { // cycles through every value in the array. Everything inside the Curly brackets will be run for each object in the array. var hideproduct = value.hideproduct; // value.item is simplified down var productcode = value.productcode; var productname = value.productname; var productprice = value.productprice; var listprice = value.listprice; var photoscode = value.photos_cloned_from; var childof = value.ischildofproductcode; var ProductDescriptionShort = value.productdescriptionshort; if (ProductDescriptionShort == undefined){ var ProductDescriptionShort = ""// changes "undefined" to "" (blank) so customers wont see that error }; childcheck = childof; // checks to see if the product is a child if (childcheck == ""){ var childof = productcode // changes the product code value to match the child productcode }; $("#output").append("&lt;div class='product' code='" + productcode + "'&gt;" + "&lt;a href='http://www.skates.com/-p/" + productcode + ".htm' title='" + productname + ", " + productcode + "'&gt;" + productname + "&lt;/a&gt;&lt;br&gt;" + "&lt;span&gt;&lt;font class='text colors_text'&gt;&lt;span class='listprice'&gt;List Price&lt;/span&gt;: &lt;/font&gt; $" + listprice + "&lt;/span&gt;&lt;br/&gt;&lt;span class='price'&gt;Our Price&lt;/span&gt;: &lt;/font&gt; $" + productprice + "&lt;/span&gt;&lt;br&gt;" + "&lt;div class='product_image'&gt;&lt;a href='http://www.skates.com/-p/" + productcode + ".htm' title='" + productname + ", " + productcode + "'&gt;&lt;img src='http://www.skates.com/v/vspfiles/photos/" + childof + "-1.jpg' border='0' alt='" + productname + "'&gt;&lt;/a&gt;&lt;/div&gt;" + "&lt;span class='shortdescription'&gt;" + ProductDescriptionShort + "&lt;/span&gt;" + "&lt;/div&gt;") // Process and add the data to elements. }) } }) </code></pre> <h3>Json sent</h3> <pre><code>([{"productcode":"K2EMY050","productname":"K2 Enemy aggressive skates - Size 5","productprice":"39.99","hideproduct":"Y","listprice":"199.99","photos_cloned_from":"K2EMY","ischildofproductcode":"K2EMY","productdescriptionshort":""},{"productcode":"S02123060","productname":"K2 Mini Enemy - Size 4-6","productprice":"49.99","hideproduct":"Y","listprice":"149.99","photos_cloned_from":"S02123","ischildofproductcode":"S02123","productdescriptionshort":""},{"productcode":"S03109050","productname":"K2 Cadence SL - Size 5","productprice":"39.99","hideproduct":"Y","listprice":"189.99","photos_cloned_from":"S03109","ischildofproductcode":"S03109","productdescriptionshort":""},{"productcode":"S03112050","productname":"K2 Skye SL Womens - Size 5","productprice":"59.99","hideproduct":"Y","listprice":"199.99","photos_cloned_from":"S03112","ischildofproductcode":"S03112","productdescriptionshort":""},{"productcode":"S03118050","productname":"K2 Spire XP Womens - Size 5","productprice":"99.99","hideproduct":"Y","listprice":"239.99","photos_cloned_from":"S03118","ischildofproductcode":"S03118","productdescriptionshort":""}]) </code></pre> <p>How do I fix this issue?</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