Note that there are some explanatory texts on larger screens.

plurals
  1. POUnexpected Caching of AJAX results in IE8
    primarykey
    data
    text
    <p>I'm having a serious issue with Internet Explorer caching results from a JQuery Ajax request.</p> <p>I have header on my web page that gets updated every time a user navigates to a new page. Once the page is loaded I do this</p> <pre><code>$.get("/game/getpuzzleinfo", null, function(data, status) { var content = "&lt;h1&gt;Wikipedia Maze&lt;/h1&gt;"; content += "&lt;p class='endtopic'&gt;Looking for &lt;span&gt;&lt;a title='Opens the topic you are looking for in a separate tab or window' href='" + data.EndTopicUrl + "' target='_blank'&gt;" + data.EndTopic + "&lt;a/&gt;&lt;/span&gt;&lt;/p&gt;"; content += "&lt;p class='step'&gt;Step &lt;span&gt;" + data.StepCount + "&lt;/span&gt;&lt;/p&gt;"; content += "&lt;p class='level'&gt;Level &lt;span&gt;" + data.PuzzleLevel.toString() + "&lt;/span&gt;&lt;/p&gt;"; content += "&lt;p class='startover'&gt;&lt;a href='/game/start/" + data.PuzzleId.toString() + "'&gt;Start Over&lt;/a&gt;&lt;/p&gt;"; $("#wikiheader").append(content); }, "json"); </code></pre> <p>It just injects header info into the page. You can check it out by going to <a href="http://www.wikipediamaze.com" rel="noreferrer">www.wikipediamaze.com</a> and then logging in and starting a new puzzle.</p> <p>In every browser I've tested (Google Chrome, Firefox, Safari, Internet Explorer) it works great <strong>except</strong> in IE. Eveything gets injected just fine in IE <strong>the first time</strong> but after that it never even makes the call to <code>/game/getpuzzleinfo</code>. It's like it has cached the results or something.</p> <p>If I change the call to <code>$.post("/game/getpuzzleinfo", ...</code> IE picks it up just fine. But then Firefox quits working.</p> <p>Can someone please shed some light on this as to why IE is caching my <code>$.get</code> ajax calls?</p> <p><strong>UPDATE</strong></p> <p>Per the suggestion below, I've changed my ajax request to this, which fixed my problem:</p> <pre><code>$.ajax({ type: "GET", url: "/game/getpuzzleinfo", dataType: "json", cache: false, success: function(data) { ... } }); </code></pre>
    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.
 

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