草庐IT

cross-domain-policy

全部标签

javascript - http ://required Cross Origin Resource Sharing (CORS) and preflight only happen in IE 的 XMLHttpRequest

我是一名前端开发人员。我只在客户端编码,所以我不确定是否存在错误。我一直在搜索CORS,但仍然不知道我的问题是什么。我正在尝试将数据发布到REST。$.ajax({url:urlPost,type:"POST",data:JSON.stringify(obj),dataType:"json",contentType:"application/json",success:function(res){console.log(JSON.stringify(res));},error:function(res){console.log("Badthinghappend!"+res.status

javascript - 谷歌浏览器插件 : How to get domain from URL (tab. 网址)

使用GoogleChromeAPI的tab.urlvalue,从整个值中获取域的最佳方法是什么?在JavaScript中,我会使用window.location.protocol和window.location.hostname。例如这样的事情:vardomain=window.location.protocol+"//"+window.location.hostname;但是那获取的是扩展域而不是选项卡,所以不能使用该方法。因此,使用类似于下面的函数...我如何从tab.url值中删除域?functionshow_alert(){chrome.tabs.getSelected(nul

从父域到子域的 JavaScript 访问?

我读过设置document.domain="example.com"允许我从子域访问父域。反之亦然吗?假设我的主站点在http://example.com下运行。我想通过AJAX(GET和POST)访问的所有API函数都托管在http://api.example.com上。我可以从example.com访问api.example.com吗?编辑:再次查看document.domain,我认为这不会解决问题。调用api.example.com的结果不是必需的HTML,而是API服务器上运行的PHP脚本的输出。它可以是JSON、纯文本等。因此无法为此设置document.domain(因为

javascript - 即使正确设置了 document.domain,跨子域 ajax 请求也被拒绝

在我的应用程序中,我在一个子域(dev.u413.com)上有一个网站,我使用jQuery向另一个子域(api.u413.com)上的JSONapi发出ajax请求。当我检查Chrome开发工具和FirefoxFirebug中的请求时,我的请求似乎被Access-Control-Allowed-Origin阻止了。我将document.domain设置为当前域的后缀:document.domain='u413.com';。这是我的要求:$.ajax({dataType:'json',data:{parseAsHtml:true,cli:'help'},url:'http://api.u

javascript - 设置 document.domain 是否适用于所有(大多数)浏览器?

SameOriginPolicyDocumentation是这样说的:Thereisoneexceptiontothesameoriginrule.Ascriptcansetthevalueofdocument.domaintoasuffixofthecurrentdomain.Ifitdoesso,theshorterdomainisusedforsubsequentoriginchecks.Forexample,assumeascriptinthedocumentathttp://store.company.com/dir/other.htmlexecutesthefollowin

php - 跨源请求被阻止 : The Same Origin Policy disallows reading the remote resource at url

这是非常著名的浏览器错误。我知道它已经被讨论了很多,但我注意到这是一个非常普遍的错误,所以我想提出我的问题。我正在我有权访问的服务器上发出简单请求(获取、发布)。我的浏览器(chrome、firefox)给我Cross-OriginRequestBlocked:TheSameOriginPolicydisallowsreadingtheremoteresourceaturl(原因:CORSheader'Access-Control-Allow-Origin'doesnotmatch'null').错误。当我使用一些(黑客)插件时,我得到了很好的响应。我尝试的是在我的后端(在服务器上)添

php - 无法加载 URL : The domain of this URL isn't included in the app's domains. 要能够加载此 URL... Codeigniter

我正在尝试使用codeigniterphp登录facebook应用程序。我收到错误:WarningCan'tLoadURL:ThedomainofthisURLisn'tincludedintheapp'sdomains.TobeabletoloadthisURL,addalldomainsandsubdomainsofyourapptotheAppDomainsfieldinyourappsettings.我做了一些研究,我认为我在Facebook应用程序中的有效OAuth重定向URI是错误的/无效的。有人可以指导我如何解决这个问题吗?这是我的链接图片 最

php - 拉维尔 5.5 : Authorization Policy AccessDeniedHttpException This action is unauthorized

我创建了一个授权策略,所以我遇到了这个问题。我已经看到了这些解决方案,但我的问题还没有解决:Solution1Solution2Solution3代码如下:ArticalesController类中使用的函数:publicfunctionshow(Articale$articale){$this->authorize('view',$articale);returnview('articales.show',compact('articale'));}ArticalePolicy类:id==$articale->user_id;}AuthServiceProvider类:namespa

php - Symfony2 - Doctrine2 : Cross-Database Join Column throws Mapping-Exception

您好,想在两个实体之间进行连接。实体在不同的数据库中:这是我设置数据库配置的方式:doctrine:dbal:default_connection:defaultconnections:default:driver:%database_driver%host:%database_host%port:%database_port%dbname:%database_name%user:%database_user%password:%database_password%charset:UTF8mapping_types:enum:stringdata_warehouse:driver:%d

php - Facebook 授权 : Can't Load URL: The domain of this URL isn't included in the app's domains

我知道这个问题之前在这个链接中被问过FacebookOAuth"ThedomainofthisURLisn'tincludedintheapp'sdomain",但该解决方案对我不起作用。它显示的错误是这样的:我也将我的域包含在应用程序的facebookapi域中,我传递的重定向url格式如下所示:https://example.com/clients/authorization/facebook/a1njk2nkll55343nlk4/page这里facebook/后面的随机字符是动态的客户端id。此外,我在通过facebook登录时也遇到了同样的问题。谢谢。