开发者

extra querystring data on jQuery.ajax()

For all intense purposes what I have is working, however, I wanted to know what this extra querystring data is and where it's coming from.

jQuery.ajax({
        url: 'MyFile.aspx/ProcessRequest',
        data: JSON.stringify({status: status }),
        async: false,
        dataType: 'application/json',
        cache: false,
        success: function (data) {
  // ... do stuff with data...
  });

Using tamperdata and also viewing the Request.QueryString in the debugger the resulting url is:

http://localhost/Folder/MyFile.aspx/ProcessRequest?_=1298057136790&{%22status%22:%22pqs%22}

So where does this _1298057135790 come from and why is it there开发者_C百科?


Browser and proxy server often cache the requests. By appending this, you will get fresh data. you have used the following in code.

cache:false

Changing this will remove it but it is a great chance that you may get old data, even if browser cache is disabled.


I believe that is an attempt by stringify() or ajax() to randomize a portion of the URL so that you don't get cached data from the browser back, but get real live data from the server instead. Many browsers and web servers will cache based on the uniqueness of the URL

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜