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’);的值
百度了很多天,没找到办法