在页面中有如下代码断:
if(req){
req.open("GET",url, true);
req.onreadystatechange = function(){
if (req.readyState == 4 && req.status == 200) {
var info = req.responseText;
alert(info);//A
window.open('print.jsp','打印');//B
}
}
req.send(null);
} 语句A可以显示,但B却执行不了,页面也没报错,试过其他的方式也不能跳转,不知道是不是ajax的回调中读取路径有问题!望高人指教!!
if(req){
req.open("GET",url, true);
req.onreadystatechange = function(){
if (req.readyState == 4 && req.status == 200) {
var info = req.responseText;
alert(info);//A
window.open('print.jsp','打印');//B
}
}
req.send(null);
} 语句A可以显示,但B却执行不了,页面也没报错,试过其他的方式也不能跳转,不知道是不是ajax的回调中读取路径有问题!望高人指教!!
var req;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
req = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
}
var url = "b.htm";
if(req){
req.open("GET",url, true);
req.onreadystatechange = function(){
if (req.readyState == 4 && req.status == 200) {
var info = req.responseText;
alert(info);//A
window.open('print.jsp','打印');//B
}
}
req.send(null);
}
</script>
出现了#号以前的字符,这是咋回事呢???