以下将目标设置为_blank:
if (key == "smk") {
window.location = "http://www.smkproduction.eu5.org";
target = "_blank";
done = 1;
}
但这似乎不起作用。如何在新标签页中启动链接?
这是我的代码:
function ToKey() {
var done = 0;
var key = document.tokey.key.value;
key = key.toLowerCase();
if (key == "smk") {
window.location = "http://www.smkproduction.eu5.org";
target = "_blank"
done = 1;
}
if (done == 0) {
alert("Kodi nuk është valid!");
}
}
<form name="tokey">
<table>
<tr>
<td>Type the key</td>
<td>
<input type="text" name="key">
</td>
<td>
</td>
<td>
<input type="button" value="Go" onClick="ToKey()">
</td>
</table>
</form>
因此,您想在新窗口中打开一个网址吗?
—
穆萨
是的!! 仅在钥匙正确的情况下……
—
Flamur Beqiraj 2013年
哪里
—
卢卡斯
HEAD关门?