开发者

.getJSON call to URL

I'm a little confused as to what exactly is going on here. For instance...

http://bidstick.com/latest/21249%7C21250%7C21252.js&localtime=1263468042061/

Is pulling down some JSON information, and the numbers being 开发者_JAVA技巧passed are specifying which auctions need information, but what is processing these variables. Is there some server side script that generates the JSON? It appears to be dynamic, as you can manually change the numbers and get a different response. I.E. just change any of the numbers in the link and it will provide different information. Thanks in advance.


I think what is puzzling you is: how does the response change when the parameters in the URL are changed?

If so, here's your answer:

Server side scripts are generating the output that you see. These scripts read the input URL and know what parameters to work on. (More accurately, these parameters are GET arguments). So a server script can read this, and decide what to do accordingly.

PS: now I come to think of it, you must be knowing all this, since you already know what JSON is.

EDIT:


Such scripts are not for the perusal of users of the website. This output is for use by the website itself, or for use by other websites.


To accomplish this: there are two ways I can think of:

  1. URL rewriting
  2. processing PHP inside a .js file (yes this is possible).
    You can do that by telling Apache that .js files should be processed by PHP
    I believe that can be done using the AddType directive of Apache's config file.


Yes, there is a server-side script that is generating some kind of JSON-serialized output. Both ASP.NET MVC and Ruby on Rails have really simple ways of generating JSON results from what look like standard URLS.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜