The following sets the target for "_blank":
if (key=="smk") { window.location="http://www.smkproduction.eu5.org"; target="_blank"; done=1; }
But this does not seem to work. How to launch a link in a new tab?
Here is my code:
<HEAD> <script LANGUAGE="JavaScript"> <!-- Begin 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!"); } } </SCRIPT> <BODY> <center> <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>
javascript
Flamur Beqiraj Aug 27 '13 at 22:14 2013-08-27 22:14
source share