bestjovi
(bestjovi)
新手上路

初级会员
UID 66179
精华
0
积分 6
帖子 11
金钱 6 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2005-8-25
状态 离线
|
[广告]: 代充Paypal帐号美元
xmlhttp的跨域名open请求
文件test.html内容
<?php <script> function xmlrequest() { try { xmlhttp = new ActiveXObject("MSXML2.XMLHTTP"); } catch (e1) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
} catch (e2) { alert("浏览器不支持,请更换"); return false; } } xmlhttp.open("GET", "http://a.test.com", false); xmlhttp.send(); document.write(xmlhttp.responseText); } </script> ?> 如果将test.html文件放到b.test.com服务器上,请求a.test.com则无法执行,系统提示"没有权限"
请问如何才能正确请求
|
|