Tuesday, April 5, 2011

Getting ResponseText without calling servlet using xmlhttprequest in IE(Any version)

Hi, I'm using xmlhttprequest to call servlet. It is working fine in Firefox. But, in IE, only if I click refresh button, it is working(that too sometimes). Otherwise, it is not triggering. Moreover, the response text is displayed without calling the servlet. Is that using Cache or what? I don't have any idea . Help me out please.

From stackoverflow
  • MSIE is too eager in caching XHR requests. The only feasible way to get around this is to add a querystring with a timestamp to the XHR URL.

    var url = '/url/to/your/servlet?' + new Date().getTime();
    

0 comments:

Post a Comment