2014-02-17 20 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

相關問題