2014-02-17 22 views
-3

这是我的脚本如何打开一个新的弹出窗口或窗口使用tr标签与JavaScript?

tr style='cursor:hand' onclick="javascript:location.href='list.php?no=$row[no]'" 

它在同一窗口弹出:

我想我必须使用像成才

onclick="javascript:[           ]='list.php?no=$row[no]'" 

我怎么能有新的弹出窗口或窗口?

我使用了href=,但它没有在铬中工作,所以我不想使用href标签。

+3

我也发现了一个谷歌和秒内该工具的http:/ /www.textfixer.com/html/javascript-pop-up-window.php,而你花了几分钟来写这个问题,那怎么样? –

回答

1

尝试用这种window.open

tr style='cursor:hand' onclick="javascript:window.open('list.php?no=$row[no]');"

看到window.open

更新2

tr style='cursor:hand' onclick="javascript:window.open('list.php?no=$row[no]', 'my_window');"

+0

它的作品,但仍然在铬窗口.. – user3317971

+0

尝试更新2 –

0

,必须先创建这样的函数

function openPopUp(url) 
{ 
    var newwindow=window.open(url,'name','height=200,width=150'); 
    if (window.focus) {newwindow.focus()} 
} 

,比你应该有这样的

tr style='cursor:hand' onclick="openPopUp('list.php?no=$row[no]')" 

代码它会打开新的弹出与高度200和宽度150

+0

完美!这就是我要的!谢谢 ! – user3317971

相关问题