1.No ' Access-control-allow-origin ' header is present on the requested
Recently in the channel of HTML5, encountered cross-domain problem, using JS Ajax post or Get method, only to the target URL slightly different, there will be cross-domain issues, the browser will be the security of their own initiative to intercept.
This problem is in fact not the client can solve, preferably the target URL of the server code is you can control. The most convenient solution is to add code to the server-side page you are visiting. For example, your address today is http://a.company.com to visit http://b.company.com. You should add code that agrees to cross-domain access in http://b.company.com.
PHP code such as the following:
Header (' access-control-allow-origin: * '); Header ("Access-control-allow-credentials:true"); Header (' Access-control-allow-methods:get, PUT, POST, DELETE, OPTIONS '); Header (' access-control-max-age:1000 '); Header (' Access-control-allow-headers:content-type, Content-range, content-disposition, Content-description ');
2. Jump or there will be a problem
For example, you are in the http://b.company.com of the server code and jump to http://c.other.com, and http://c.other.com not under your control, then you can use this little tricks. Return URL to JS, let JS through location.href = "http://c.other.com" to jump.
http://www.waitingfy.com/archives/1737
HTML5 cocos2d JS Access-control-allow-origin