可以通过AJAX请求的资源使用一个基于PHP脚本代理? [英] Can resources requested via AJAX be proxied using a PHP-based script?
问题描述
我想知道是否有可能为一个基于PHP的代理来处理Ajax数据。 我试图做一个或使用现成的脚本。
I was wondering if it's possible for a PHP-based proxy to handle AJAX data. I'm trying to make one or use a ready-made script.
谢谢!
推荐答案
是的。
您的客户端JavaScript可以使一个AJAX请求到同一个域的服务器端脚本(如PHP在这个例子中),PHP脚本便可以提出要求第三方URL,处理它然而,然后结果返回到原来的客户端JavaScript。
Your client-side javascript can make an AJAX request to a same-domain server side script (e.g. PHP in this example), the PHP script could then make a request to a third-party url, process it however, and then return the result to the original client-side javascript.
如果可以提供一些额外的细节,I或别人,也许能提供更具体的解决方案/解释
If you can provide some additional detail, I, or someone else, may be able to provide a more concrete solution/explanation.
编辑:请参见 http://developer.yahoo.com/javascript/howto-proxy .HTML 的过程中一个很好的解释。
See http://developer.yahoo.com/javascript/howto-proxy.html for an excellent explanation of the process.
这篇关于可以通过AJAX请求的资源使用一个基于PHP脚本代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!