I've had the honor of writing for this year's PHP Advent, blessing you all about Cross-Origin Requests with CORS:
我很荣幸为今年PHP Advent撰写文章,向大家祝福CORS的跨域请求:
There's no doubt that Ajax is one of the most exciting, useful, and necessary web technologies available to front-end developers. Unfortunately, it's also one of the most restrictive — especially when it comes to gathering content from other domains. Web developers are nothing if not persistent, so we've come up with a variety of ways to get around cross-origin restrictions, including JSONP, server-side proxies made with PHP, ProxyPass proxying, Flash transports, creative iFrame uses, and more. What many developers don't know is that there's a W3C specification called Cross-Origin Resource Sharing, or CORS, which provides a standard for cross-origin Ajax requests with minimal hassle.
毫无疑问,Ajax是前端开发人员可以使用的最令人兴奋,有用和必要的Web技术之一。 不幸的是,它也是最严格的限制之一-尤其是从其他域收集内容时。 Web开发人员即使不是持久的也不是什么,所以我们想出了各种方法来克服跨域限制,包括JSONP,用PHP制作的服务器端代理,ProxyPass代理,Flash传输,创造性的iFrame使用等等。 。 许多开发人员不知道的是,有一个称为跨域资源共享(CORS)的W3C规范,该规范为跨域Ajax请求提供了一个标准,并且麻烦最少。
That's my Christmas gift to you all!
那是我给大家的圣诞节礼物!