在页面中有如下代码断:
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的回调中读取路径有问题!望高人指教!!

解决方案 »

  1.   

    我copy了一下你的源码,没问题,可以打开,只是我没有你的print.jsp而已。<script>
    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>
      

  2.   

    应该是路径问题,如果print.jsp在某一个应用下那么试试./print.jsp
      

  3.   

    jsp的路径,你那么写能打开吗?
      

  4.   

    现在可以执行window.open()了,但页面还是找不到,点击右键查看"属性",发现地址变成了:res://ieframe.dll/http_500.htm#http://localhost:7001/unicom/net_grid/print.jsp
    出现了#号以前的字符,这是咋回事呢???