客户端脚本<script language="javascript" type="text/javascript">
function GetAjaxValue(url)
{
var randomNum = Math.random();
var objXMLHttp;
if(window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
xmlHttp.Open("GET",url,false);
xmlHttp.Send(null);
var returnValue;
if(xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
returnValue = xmlHttp.responseText;
}
else
{
returnValue = xmlHttp.responseText;
}
}
else
{
returnValue = xmlHttp.responseText;
}
return(returnValue);
}
var url = "../SetSession.aspx";
window.open('../SetSession.aspx','test','width:1200px;height:700px');
var temp = GetAjaxValue(url); </script>
服务端代码protected void Page_Load(object sender, EventArgs e)
{
try {
// 执行相关操作 Response.Write(("true"));
}
catch (Exception ex) {
Response.Write(ex.Message);
}
finally {
Response.End();
}
}
window.open('../SetSession.aspx','test','width:1200px;height:700px')
返回的是true
可是temp 是页面出错信息的一大堆代码,而且中文都是乱码不知道是什么错误
请帮忙看一下
谢谢
function GetAjaxValue(url)
{
var randomNum = Math.random();
var objXMLHttp;
if(window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
xmlHttp.Open("GET",url,false);
xmlHttp.Send(null);
var returnValue;
if(xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
returnValue = xmlHttp.responseText;
}
else
{
returnValue = xmlHttp.responseText;
}
}
else
{
returnValue = xmlHttp.responseText;
}
return(returnValue);
}
var url = "../SetSession.aspx";
window.open('../SetSession.aspx','test','width:1200px;height:700px');
var temp = GetAjaxValue(url); </script>
服务端代码protected void Page_Load(object sender, EventArgs e)
{
try {
// 执行相关操作 Response.Write(("true"));
}
catch (Exception ex) {
Response.Write(ex.Message);
}
finally {
Response.End();
}
}
window.open('../SetSession.aspx','test','width:1200px;height:700px')
返回的是true
可是temp 是页面出错信息的一大堆代码,而且中文都是乱码不知道是什么错误
请帮忙看一下
谢谢
xmlHttp.readyState 为 4
而 xmlHttp.status 为 404
但是服务端代码调试是正确的
window.open('../SetSession.aspx','test','width:1200px;height:700px')打开的窗口显示的也是true值