Poniższe wyznacza cel do _blank
:Jak dodać target = "_ blank" do JavaScript window.location?
if (key == "smk") {
window.location = "http://www.smkproduction.eu5.org";
target = "_blank";
done = 1;
}
Ale to nie wydają się działać. Jak uruchomić link w nowej karcie?
Oto mój kod:
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>
Więc chcesz otworzyć link w nowym oknie ? – Musa
Yepp ?! tylko jeśli klucz jest właściwy ... –
gdzie "HEAD" zamyka się? – Lucas