[jQuery] Problems with Ajax and caching
Hi!
I'm creating a ajax call like this:
jQuery.ajax({ url: "http://urltopage/?callback=callbackhandler",
dataType: "json", type: "GET", cache: true, callback: null, data:
null });
I then have a callbackhandler function like this:
function callbackhandler(data){
do something here
}
The response from the server is actually a json-p like "callbackhandler
(myjsonobject)" but I'm using this type of ajax requst to be able to
use client caching. If I use $.json() the request will get a "?
callback=randomstring" which will diable client caching.
Now to my problem. Sometimes, and only sometimes, this does not work.
I do not get a js error or ajax error but a requst is never made. This
problem only occurs when using caching. If I set cache to false it
works 100%.
Any one that could understand why this happens? How do I cache cross
domain json-p calls with jquery?
//Magnus