From 400b2d766344dd2bbd03a7aea43c8a9abe54441f Mon Sep 17 00:00:00 2001 From: VisualSJ Date: Thu, 18 Jun 2015 09:23:15 +0800 Subject: [PATCH] Fixed a bug that xhr cross-domain error --- tests/js-tests/src/XHRTest/XHRTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/js-tests/src/XHRTest/XHRTest.js b/tests/js-tests/src/XHRTest/XHRTest.js index 5d468363d6..2334255201 100644 --- a/tests/js-tests/src/XHRTest/XHRTest.js +++ b/tests/js-tests/src/XHRTest/XHRTest.js @@ -107,10 +107,10 @@ var XHRTestLayer = cc.Layer.extend({ //set arguments with ?xxx=xxx&yyy=yyy if(cc.sys.isNative){ xhr.open("GET", "http://geek.csdn.net/news/detail/33683", true); - xhr.setRequestHeader("Accept-Encoding","gzip,deflate"); }else{ xhr.open("GET", "http://httpbin.org/get?show_env=1", true); } + xhr.setRequestHeader("Accept-Encoding","gzip,deflate"); xhr.send(); },