如何测试从实时网站提取数据的AJAX应用程序?
I'm working on a AJAX application that pull data from a live website, I can't replicate the complete application on my local environment at the moment so in order to test if the Javascript code is working as expected I need to be able to bypass the same domain restriction on the browser (without making changes on the web server) any suggestion will be greatly appreciated.
我工作在一个AJAX应用程序把数据从一个生活网站,我在当地不能复制完整的应用程序环境目前为了测试Javascript代码是否按预期工作我需要能够绕过同一域限制浏览器(没有在web服务器上进行更改)任何建议将不胜感激。
So far I have tried modifying the prefs.js in Firefox 2 and Camino including the lines suggested in this link: http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/
到目前为止,我已经尝试修改了prefs。Firefox 2和Camino中的js,包括链接中建议的行:http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/
Thanks in advance.
提前谢谢。
Edit 04/29/2009 3:18pm:
编辑04/29/2009 3:18pm:
I agree the proxy option is definitely a way to go. But would it be possible to have a solution using just Firefox? (maybe an add-on?)
我同意代理权选择绝对是一条路。但是仅仅使用Firefox就能解决问题吗?(也许一个插件吗?)
2 个解决方案
#1
4
If you can change the endpoint URL you could bounce the requests through your local server, either with mod_rewrite or a simple script.
如果可以更改端点URL,可以通过mod_rewrite或简单的脚本在本地服务器上执行请求。
This has the advantage that you can easily log the requests and responses, and alter them (e.g. send back timeout errors, bad data and the like).
这样做的好处是,您可以轻松地记录请求和响应,并更改它们(例如发送回超时错误、坏数据等)。
更多相关文章
- 如何在单击按钮时将桌面应用程序导航到系统中设置的默认邮件提供
- Angular 2快速入门 - 我的应用程序组件未加载
- 如何访问远程节点。浏览器中的js应用程序,而不是本地主机
- 如果外部应用程序更改了持久模型(服务器数据库),AngularJS可以自
- 某老师给我的javascript学习建议
- 将敏感数据存储在数据库中,建议
- 在两台服务器上有效地在两个Django应用程序之间进行通信(多租户)
- 如何停止Py_Initialise应用程序的崩溃?
- 轮询Web服务的最佳方式(例如,对于Twitter应用程序)