跨域错误 [英] Cross-domain error

查看:109
本文介绍了跨域错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是跨域错误?

推荐答案

据了解,客户端工具(如Silverlight)也许Flash / Javascript)当您尝试连接到通常只允许在与该页面发送到同一个域的某个服务器(某些原始策略)时,会引发跨域错误。

As I understand it, client-side tools such as Silverlight (and maybe Flash/Javascript) throw a cross-domain error when you attempt to make a connection to a server that is normally only allowed when it is made to the same domain that the page was served from (some origin policy).

例如,当您尝试调用实时服务器或正在查看测试时,您正在查看测试服务器上的页面时,可能会引发跨域错误页面作为使用文件://协议的本地文件。

A cross-domain error may be thrown when, for example, you are viewing a page on your test server when it is trying to call your live server, or when you are viewing a test page as a local file using a file:// protocol.

请确保您正在测试的域与该网站设计的域名相同。请注意,Flash具有crossdomain.xml功能,特别允许您执行跨域请求。 Javascript也有方法绕过同一起源政策,但您应该了解您正在做的事情的含义。

Try ensuring that the domain you are testing on is the same as that which the site was designed to be on. Note that Flash has the crossdomain.xml feature which specifically allow you to do cross-domain requests. Javascript also has ways to get around same origin policy, but you should be aware of the implications of what you're doing.

这篇关于跨域错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆