duanpei8518 2011-07-23 13:16
浏览 31
已采纳

jQuery getJSON() - 调用什么服务器?

When using PHP I can use file_get_contents or cURL to get a URL.

jQuery runs on the client

In jQuery there is a function called jQuery.getJSON(). Javascript is run on the client. What server is used for the download of the JSON code of the external URL? What information does the called URL know about? Does it know of the domain? The IP of the client user? It's a client language.

Prefered for many request

To make many requests, is it safer to do this with Javascript than PHP because it runs on the every client instead of one server point?

  • 写回答

3条回答 默认 最新

  • duandong1869 2011-07-23 13:21
    关注

    What server is used for the download of the JSON code of the external URL?

    The one that the domain name in the URL passed to that function resolves to.

    What information does the called URL know about?

    It is an HTTP request, like any other. The usual information will be available.

    Does it know of the domain? The IP of the client user?

    Of course.

    It's a client language.

    … making an HTTP request.

    To make many requests, is it safer to do this with Javascript than PHP because it runs on the every client instead of one server point?

    You control the server. You don't control the client. JavaScript can be disabled. It is safer to make the request from your server.

    (For a value of "safe" equal to "Less likely to fail assuming the service you are using doesn't impose rate limiting")

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答