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, as long as the target URL slightly different, there will be cross-domain problems, the browser will be automatically blocked due to security issues.
This problem is not the client can be solved, preferably the target URL of the server code is you can control, the most convenient solution is the server-side page you access to add code. For example, your current address is http://a.company.com. To access http://b.company.com, you should include code that allows cross-domain access in http://b.company.com.
The PHP code is as follows:
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 in the Http://b.company.com server code and jump to http://c.other.com, and http://c.other.com not under your control, then you can use such a small trick, return URL to JS, let JS through Location.href = "http://c.other.com" to jump.
http://www.waitingfy.com/archives/1737
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
HTML5 cocos2d JS Access-control-allow-origin