Foxtable(狐表)用户栏目专家坐堂 → [求助]获取xmlhttp.send数据


  共有1878人关注过本帖平板打印复制链接

主题:[求助]获取xmlhttp.send数据

美女呀,离线,留言给我吧!
OKK
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:407 积分:4268 威望:0 精华:0 注册:2016/11/22 19:30:00
[求助]获取xmlhttp.send数据  发帖心情 Post By:2019/6/6 14:59:00 [只看该作者]

case "attention"的代码:

 


sb.AppendLine("            <html>     ")

sb.AppendLine("            <head>     ")

sb.AppendLine("            <title></title>     ")

sb.AppendLine("            <script type=‘text/javascript’>     ")

sb.AppendLine("                function loadXMLDoc() {     ")

sb.AppendLine("                    var xmlhttp;     ")

sb.AppendLine("                    if (window.XMLHttpRequest) {     ")

sb.AppendLine("                        xmlhttp = new XMLHttpRequest();     ")

sb.AppendLine("                    }     ")

sb.AppendLine("                    else {     ")

sb.AppendLine("                        xmlhttp = new ActiveXObject(‘Microsoft.XMLHTTP’);     ")

sb.AppendLine("                    }     ")

sb.AppendLine("                    xmlhttp.onreadystatechange = function () {     ")

sb.AppendLine("                        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {     ")

sb.AppendLine("                            document.getElementById(‘myDiv’).innerHTML = xmlhttp.responseText;     ")

sb.AppendLine("                        }     ")

sb.AppendLine("                    }     ")

sb.AppendLine("                    xmlhttp.open(‘POST’, ‘attention1.aspx’, true);     ")

sb.AppendLine("                    xmlhttp.setRequestHeader(‘Content-type’, ‘application/x-www-form-urlencoded’);     ")

sb.AppendLine("                    xmlhttp.send(‘a=123’);     ")

sb.AppendLine("                }     ")

sb.AppendLine("            </script>     ")

sb.AppendLine("            </head>     ")

sb.AppendLine("            <body>     ")

 

sb.AppendLine("            <h2></h2>     ")

sb.AppendLine("            <button type=‘button’ onclick=‘loadXMLDoc()’>获取attention1.aspx文件的数据</button>     ")

sb.AppendLine("            <br />     ")

sb.AppendLine("            <br />     ")

sb.AppendLine("            <br />     ")

sb.AppendLine("            <div id=‘myDiv’ style=‘color:red’></div>     ")

 

sb.AppendLine("            </body>     ")

sb.AppendLine("            </html>     ")

 

 

case "attention1"的代码:

 


sb.AppendLine("            <html>     ")

sb.AppendLine("            <head>     ")

sb.AppendLine("            <title>123</title>     ")

sb.AppendLine("            </head>     ")

sb.AppendLine("            <body>     ")

sb.AppendLine("            4567890      ")

sb.AppendLine("            </body>     ")

sb.AppendLine("            </html>     ")

 

 

 

 

 

 


此主题相关图片如下:iqmo4rap%hmf}7xg6j0grt.png
按此在新窗口浏览图片

 

 

 

 

 

 

怎么才能让case "attention1" 获取到xmlhttp.send(‘a=123’);的值

 

 

 

 

 

 

 

 

 

 

 

 

百度了很多天,没找到办法

 

 

 


 回到顶部