.getJSON 调用 URL
我对这里到底发生了什么感到有点困惑。例如...
http://bidstick.com/latest/ 21249%7C21250%7C21252.js&localtime=1263468042061/
正在拉取一些JSON信息,传递的数字正在指定哪些拍卖需要信息,但是什么在处理这些变量。是否有一些服务器端脚本可以生成 JSON?它看起来是动态的,因为您可以手动更改数字并获得不同的响应。 IE 只需更改链接中的任何数字,它就会提供不同的信息。提前致谢。
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 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想你困惑的是:当URL中的参数改变时,响应如何改变?
如果是这样,这就是您的答案:
服务器端脚本正在生成您看到的输出。这些脚本读取输入 URL 并知道要处理哪些参数。 (更准确地说,这些参数是 GET 参数)。因此服务器脚本可以读取此内容,并相应地决定要做什么。
PS:现在我想起来,你一定知道这一切,因为你已经知道 JSON 是什么了。
编辑:
此类脚本不适合网站用户的阅读。此输出供网站本身使用,或供其他网站使用。
为了实现这一点:我可以想到两种方法:
您可以通过告诉 Apache
.js
文件应由 PHP 处理来做到这一点我相信可以使用 Apache 配置文件的 AddType 指令来完成。
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:
.js
file (yes this is possible).You can do that by telling Apache that
.js
files should be processed by PHPI believe that can be done using the AddType directive of Apache's config file.
是的,有一个服务器端脚本正在生成某种 JSON 序列化输出。 ASP.NET MVC 和 Ruby on Rails 都有非常简单的方法从看起来像标准 URL 的内容生成 JSON 结果。
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.