Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery $.ajax Not Working in IE8 but it works on FireFox & Chrome
    primarykey
    data
    text
    <p>I have the following ajax call which works perfectly in Firefox and Chrome but not IE:</p> <pre><code>function getAJAXdates( startDate, numberOfNights, opts ) { var month = startDate.getMonth() + 1; var day = startDate.getDate(); var year = startDate.getFullYear(); var d = new Date(); var randNum = Math.floor(Math.random()*100000000); $.ajax({ type : "GET", dataType : "json", url : "/availability/ajax/bookings?rand="+randNum, cache : false, data : 'month='+month+'&amp;day='+day+'&amp;year='+year+'&amp;nights='+numberOfNights, contentType : 'application/json; charset=utf8', success : function(data) { console.log('@data: '+data); insertCellData(data, opts, startDate); }, error:function(xhr, status, errorThrown) { console.log('@Error: '+errorThrown); console.log('@Status: '+status); console.log('@Status Text: '+xhr.statusText); } }); } </code></pre> <p>I know for a fact that all the variables are passing the right content and $.ajax is indeed passing all the paramater/values. </p> <p>This is what I get on error:</p> <p>LOG: @Error: undefined LOG: @Status: parsererror LOG: @Status Text: OK</p> <p>I'm aware of the cache issue on IE and implemented a random paramater to clear it up.</p> <p>Here is the JSON i get back (i'm able to see it using Charles)</p> <pre><code>{ "availability":[ { "inventory_id":"5", "booking_id":"21", "start_date":"05-01-2010", "number_nights":4, "text":"deFrancisco, Martin - $500.00 ACTIVE", "type":"BOOKING" } ] } </code></pre> <p>Finally these are the headers that are sent back from the backend:</p> <pre><code>header('Content-Type: application/json; charset=utf8'); header("Cache-Control: no-cache"); header("Expires: 0"); header('Access-Control-Max-Age: 3628800'); header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE'); </code></pre> <p>Any ideas?</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