重定向到另一个页面

时间:2009-03-03 21:28:20

标签: php javascript

< type =“button”value =“PRINT”onClick =“window.open('print.php?id =& sec =& subj =& type = viewrec2& Year =& faci =','mywindow', '宽度= 800,高度= 800,左= 0,顶部= 100,screenX = 0,screenY = 100')“>

当我点击此按钮后,我被重定向到一个新窗口。问题是在这个按钮所在的主页面上我想要它也将它重定向到同一个窗口的上一页我怎么能用im和javascript做到这一点?

2 个答案:

答案 0 :(得分:4)

<input type="button" value="PRINT" onClick="window.open('print.php?id=&sec=&subj=&type=viewrec2&Year=&faci= ','mywindow','width=800,height=800,left=0,top=100,screenX=0,screenY=100');history.back()"> 

答案 1 :(得分:1)

添加

history.go(-1);

将代码更改为:

<input type="button" value="PRINT" onClick="window.open('print.php?id=&sec=&subj=&type=viewrec2&Year=&faci= ','mywindow','width=800,height=800,left=0,top=100,screenX=0,screenY=100');history.go(-1)">