So I was getting a little frustrated when trying to find an answer (client-side) to the issue that I had on a new tutorial I am writing. Usually if I find something tedious, but easy, I try to post a short write up. I was creating a Math application for my daughter, that presents her with 2 single digit numbers to add, once entered, you push enter and if right, the application dynamically gathers a new random question from the server. On IE, this was fairly straightforward. Here is my Javascript, using JQuery and ASP.NET MVC to respond with a C# Object for parsing in the browser.
function getProblem() {
// Here is the invoke // This is the method to pass it back to.
var d = new Date();
$.getJSON("MathPractice/Get?" + d.getMilliseconds(), showProblem);
}
Notice that the normal method should just be $.getJSON("MathPractice/Get", responseMethodName);. This was working flawlessly in Mozilla, but noticed that in IE it never had new values. IE looks in the cache first to get the answer to this question, and oops that doesn't work. So what I did to alleviate is I added the Date() to it as a query string to make sure that it isn't going to cache the result. There is another way to do it via ASP.NET MVC, however this is the easiest fix.