大家好,
本人用struts2时有个问题,点击某按钮,触发某一个action,然后返回某一个url。但我想用window.open打开这个url,而不是整个页面跳转到这个url,怎么实现呢?

解决方案 »

  1.   

    window.open 里面有属性设置 是否重新打开页面
      

  2.   

    你是说用对话框方式打开?window.showModalDialog("viewSound.action?id="+idStr, "", "dialogWidth:220px; dialogHeight:140px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; ");
      

  3.   

    result到一个页面,然后<script type="text/javascript" charset="UTF-8">
      window.open("url","","width=200,height=200");
    </script>
      

  4.   

    indow.showModalDialog("viewSound.action?id="+idStr, ""
      

  5.   

    比如struts.xml返回的url是 <result>/WEB-INF/pages/config/a.html</result>,那么怎么把这个a.html和
     window.open("url","","width=200,height=200");中的"ur"关联起来呢?
      

  6.   

    比如struts.xml返回的url是 <result>/WEB-INF/pages/config/a.html</result>,那么怎么把这个a.html和
     window.open("url","","width=200,height=200")中的"url"关联起来呢?
      

  7.   

    我要通过action层,因为可能返回不同的url,所以不能直接写文件路径。应该要拟定一个参数,但我不知怎么把不同的返回结果和window.open(url)中的url关联起来
      

  8.   

    解决了,我用window.open('abc.action')就解决了,至于跳转到哪个页面就自己在struts.xml里面配置了。