很简单的问题:为什么会权限不足呢?
刚开始学,做了一个例子。就是想将某个网站通过AJAX技术在DIV中显示。
var xmlhttp;
function getWeather()
{
var mycity=document.getElementById("TextBox1").value;
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("GET","http://php.weather.sina.com.cn/search.php?city="+mycity,false); xmlhttp.onreadystatechange=stateChange;
xmlhttp.Send(null);
}
function stateChange()
{
if(xmlhttp.readystate==4&&xmlhttp.status==200)
{
var data=bytes2BSTR(xmlhttp.ResponseBody);
var begin=data.indexOf("天气状况begin");
var end=data.indexOf("天气状况end");
var weather=data.substring(begin+15,end);
document.getElementById("divweather").innerHTML=weather;
document.getElementById("divweather").style.visibility="visible";
}
}
但是一到红色那句就显示权限不足。这是什么问题呢