English 中文(简体)
B. 权衡交叉域名选择
原标题:Weighing Cross Domain Javascript Options

我用一些内联网书写,试图跨越领域。 我用了1.7Qu,试图权衡我的选择。 我知道有三种选择。

  1. JSONP
  2. Setting Access-Control-Allow-Origin on the webserver header
  3. Writing a proxy page

With JSONP 我仅限于GET的请求。 我有一些大数据,我想说的是,用URL的长度限制来说,这样做并不可行。

在服务器上设置“准入-Allow-Origin”有助于任何飞行前请求的执行。 但我听任 Chrome和伊埃6等束缚。 我在15天左右,从当地传承到任何其他领域。 我先读过IE7+本土XmlHttpReq图表,我认为这将是一个很好的解决办法,因为Im从内联网到内联网,但我猜测,甚至连最近的神.都没有。

编写代理网页将发挥作用,但我认为,这可能太大,过于前沿工作。 页: 1 NET WCF网络服务,对总结SOAP的要求和确定内容类型感到担忧。

因此,你们的想法是什么? 难道我没有考虑让这项工作在 Chrome? 我可以忽略不计于E7。 或者,我是否应该采用代用法?

最佳回答

为了使用:

<>12>

To be absolutely sure that you get what you want, go with proxy. For small scale stuff you can literally do a one-liner in .htaccess on rewrite all URLs (provided you are using Apache) to the external host. Works just fine, debugging might be a bit difficult though, so you better be ready to read the log files on the target server, since in case of error (like 500 or similar) you get a proxy error (usually 502) instead in the browser. The only negative side is that it needs a decent server, if the load gets too big, but simply switching Apache to Ngnix will give you a great boost, so don t be afraid to use it.

Access-Control-Allow-Origin

一件大事,但没有得到支持; IE8, 运营商(尽管如此工作)和其他一些老的浏览器。 如不需要某些浏览器支持,请上。 关于使用CORS的第

http://www.ohchr.org。

如果你能够负担代用产生的额外服务器负荷,那么你可能会通过将申请分成几部分并单独发送,而比单纯的代理更需要一个包裹。 除此以外,工作相当出色。

问题回答




相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签