开发者

what is _somenumber in the ajax call query string in jquery ajax

I am using ajax jquery for most of my ajax calls , it always appends the following string

&_=1292194867553 at the end of the url , may i know what is this no

is it something related to ajax cache false or true , i tried changing both to true and both to false , but开发者_C百科 it still adds this number at the end of the call

Thanks `


It's designed to prevent the AJAX response from being cached by the browser by altering the requested URI. The random number is most probably a timestamp so it is never the same for subsequent requests.

In response to the second part of your question, set the cache property to true to prevent this. See http://api.jquery.com/jQuery.ajax/


This parameter is used to prevent caching. The number is changed every time (it is a millisecond timestamp, if i recall correctly). This prevents the browser from caching that URL since it is considered a different query.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜