backbone.js and CORS
backbone.js and CORS
我已经能够用fetch()
实现CORS响应。
然而,当我查看save()
时,使用PUT
的模型无法实现这一点。返回的响应是
OPTIONS http://[external domain] 501 (Not Implemented)
XMLHttpRequest cannot load http://[external domain]. Origin http://127.0.0.1:8888 is not allowed by Access-Control-Allow-Origin.
有人能给我一个如何更改主干同步来实现这一点的例子吗?或者这可能吗?
当您使用CORS执行除GET
以外的任何操作时,您必须按照以下问题/答案所述进行飞行前流程:CORS-How do';飞行前';httprequest?以及在这篇博客文章中:http://avalanche123.com/blog/2011/10/10/cross-domain-javascript-lessons-learned/
除了简单的GET CORS工作流程之外,您还需要执行一些额外的步骤。
看看easyXDM。它为实现向后兼容的CORS提供了一个简单的接口。我没有任何关于如何实现Backbone.sync的示例,但它应该是非常直接的。
希望这能有所帮助!
相关文章:
- CORS-重定向到第二个GET正在接收的页面
- Selenium WebDriver and JavaScript change
- node.js请求数据事件未在CORS ajax调用中触发
- 带有凭据的角度文件上载(CORS)不起作用
- 与域在同一台计算机上运行的NODEJS服务器的CORS错误
- SmartGWT数据源和CORS
- PHP and Javascript functions
- angular-seed web-script.js and cors
- Rails CORS and jQuery autocomplete
- Javascript and angularjs using CORS
- Cors XmlHttpRequest and Response
- HTML5 Audio, Web Audio API, CORS and Firefox
- CORS with django and angularjs
- backbone.js and CORS
- Azure API Management > CORS and POST
- CanvasContext2D drawImage() issue [onload and CORS]
- CORS Error: Angular.JS, Node.JS and Express
- AngularJS and WebAPI CORS
- ColdFusion CFC CORS and AJAX posts
- Asp.NET Web API and SignalR Cors