CallAspxPageWithJavaScript

来源:互联网 发布:win10软件界面模糊 编辑:程序博客网 时间:2024/05/18 03:43

var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

    // 异步调用
    xmlhttp.onreadystatechange = function()
    {
     if (xmlhttp.readyState == 4) // 调用完毕
     {
      if (xmlhttp.status == 200) // 加载成功
      {
       var xmldoc = xmlhttp.responseText;
       parent.FriendList.document.close();
       parent.FriendList.document.open();
       parent.FriendList.document.write("<p>");
       parent.FriendList.document.write("<HTML><body bgColor=#9999cc>");
       parent.FriendList.document.write(xmldoc);
       parent.FriendList.document.write("</body></HTML>");
       
      }
     }
    }

    var url = "AddFriend.aspx?FriendID="+document.Form1.txtBoxReceiver.value;
    
    xmlhttp.open("POST", url, true);
    xmlhttp.send();

原创粉丝点击