我對js和很少的html一無所知,但發現並修改了此站點上的此位代碼,以便我們輕鬆地輸入我們的打印機主機名以獲取到他們的配置頁面。需要更改此工作代碼才能在新窗口中打開
我想嵌入到一個小工具,但需要它打開它自己的選項卡/窗口,如果我這樣做。我已經嘗試過並且一直無法找到執行此操作的代碼。
這裏是到目前爲止(工作)代碼:
<html>
<body bgcolor=6D7E90>
<table id="content" height="30" border="0" cellspacing="0" cellpadding="0">
<tr><td>
<script>
function go(){
window.location='http://'+document.getElementById('url').value;
}
</script>
<input type='text' id='url'>
<button id='btn_go' onclick='javascript:go();'>Go</button>
</td</tr>
</table>
</body>
</html>
這工作完美。謝謝! –