XMLHttpRequest 无法加载和 Sencha touch [英] XMLHttpRequest cannot load and Sencha touch

查看:27
本文介绍了XMLHttpRequest 无法加载和 Sencha touch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家!我有个问题.当我使用 Ạjax 或 getStore 时,我在控制台 Chrome 中看到错误.

everybody! I have a problem. When i use Ạjax or getStore, i see a error in console Chrome.

XMLHttpRequest 无法加载.Access-Control-Allow-Origin 不允许 Origin.

而且,我的响应结果失败了.我不知道这个问题与这个结果有关.帮助我,如果你有一个 sulutions.:) 谢谢.

And, My response result is failed. I don't know this problem relate to this result. Help me, If you have a sulutions. :) Thanks.

当我使用 Ạjax 或 getStore 时,我在 Chrome 的控制台中看到一个错误.

When I use Ạjax or getStore, I see an error in Chrome's console.

XMLHttpRequest 无法加载.Access-Control-Allow-Origin 不允许 Origin.

XMLHttpRequest cannot load. Origin is not allowed by Access-Control-Allow-Origin.

我的响应结果失败了.我不知道这个问题与结果有关.

And my response result is failed. I don't know this problem relates to the result.

推荐答案

出于安全原因,您无法从浏览器调用任何网络服务,因此您必须使用 JSONP 应用程序端代理,或者您必须在服务器端启用 CORS.如果您打算将它构建为应用程序,那么您不必这样做,您所要做的就是在测试时更改浏览器的安全设置.更多细节在这里:如何使用json代理在开发过程中访问远程服务

You cannot call any webservice from your browser because of security reasons so either you have to use JSONP proxy on app side or you have to enable CORS on your server side. If you are planning to build this as app then you don't have to do this, all you have to do is change security setting of your browser when you are testing. More details here : How to use json proxy to access remote services during development

这篇关于XMLHttpRequest 无法加载和 Sencha touch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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