YAHOO.util.Connect.asyncRequest is useful function in YUI to make ajax call. But under ie6, there is a lethal potential bug which caused by ie6 caching.

e.g

  1. request a treenode content by id, url /tree/get/?node=1
  2. modify the treenode content, url/tree/mod/?node=1&content=x
  3. request a treenode content again, url /tree/get/?node=1

Whack..! the treenode content is same as before, has not been changed. this is caused by ie6 caching the responset(url /tree/get/?node=1). It could be solved by appending an unique random parameter to the end of url

e.g

...
 var callback =
	    {
	      success:handleSuccess,
	      failure:handleFailure
	    };
	    var sUrl = "url /tree/get/?node="+nodeid
            //appending an unique random parameter
	    sUrl += "&rnd="+new Date().getTime();
	    var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
...
Advertisements