Ajax请求aspx页面的权限问题
我写了个最简单的ajax代码,如下:function fun() {
// alert("fef");
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
//document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
alert(xmlhttp.responseText);
}
}
xmlhttp.open("GET", "Data.aspx", true);
xmlhttp.send();
}
fun();
当请求Data.aspx时xmlhttp.status=403,请问该怎么解决这个问题,谢谢大家了。 --------------------编程问答-------------------- 单独打Data.aspx试试能不能打开 --------------------编程问答--------------------
function createXMLHttps()--------------------编程问答--------------------
{
var ret = null;
try
{
ret = new ActiveXObject('Msxml2.XMLHTTP');
}
catch(e)
{
try
{
ret = new ActiveXObject('Microsoft.XMLHTTP');
}
catch(ee)
{
ret = null;
}
}
if (!ret && typeof XMLHttpRequest != 'undefined')
ret = new XMLHttpRequest();
return ret;
}
单独的可以,但用js就不可以了
补充:.NET技术 , ASP.NET