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).

这样做的好处是,您可以轻松地记录请求和响应,并更改它们(例如发送回超时错误、坏数据等)。

更多相关文章

  1. 如何在单击按钮时将桌面应用程序导航到系统中设置的默认邮件提供
  2. Angular 2快速入门 - 我的应用程序组件未加载
  3. 如何访问远程节点。浏览器中的js应用程序,而不是本地主机
  4. 如果外部应用程序更改了持久模型(服务器数据库),AngularJS可以自
  5. 某老师给我的javascript学习建议
  6. 将敏感数据存储在数据库中,建议
  7. 在两台服务器上有效地在两个Django应用程序之间进行通信(多租户)
  8. 如何停止Py_Initialise应用程序的崩溃?
  9. 轮询Web服务的最佳方式(例如,对于Twitter应用程序)

随机推荐

  1. android ExpandableListView伸缩列表
  2. Android 使用RenderScript
  3. android 布局文件 layout_weight用法
  4. Android 如何使用浏览器去下载app和加载h
  5. android process bar 几种style
  6. Android(安卓)初始化Setup Wizard——Pro
  7. Android Frameworks系列之IMF(一)
  8. 【Android文档】Android界面绘制流程----
  9. android中搭建phonegap开发环境
  10. xmlns:android作用以及自定义布局属性