Open a new tab via a custom alert
In the head: this
Usage: lines like
<a href="javascript: void(0)" onclick="open_window_via_alert('http://www.google.com', 'Click on OK if you want to go to <br>http://www.google.com<br><br>', 40)"><b>Google</b></a>
<a href="javascript: void(0)" onclick="open_window_via_alert('http://www.dynamicdrive.com', 'If you want to go to <br>http://www.dynamicdrive.com<br>click on OK<br>', 40)"><b>DynamicDrive</b></a>
First parameter of function open_window_via_alert: the page we want open (in a new tab) after a click on OK.
Second parameter of function open_window_via_alert: the text (and HTML) we want to appear in the alert box.
Third parameter of function open_window_via_alert: the size of the alert box.
Text / HTML in the alert box (second parameter):
You can insert whatever you want: text, images, HTML tags etc. But make sure not to forget backslash character when required. Put some breaks after the normal text to lower the OK button.
Size of the alert box (third parameter):
The bigger the numeral value, the smaller the window / the smaller the numeral value, the bigger the window. Best practice is to choose 40 or less. But, of course, the size of the text must be taken into account.
Demos (view source):
Google
DynamicDrive
Facebook (the dumbest thing that ever happened)
Javascriptkit (contains an image)
Arie Molendijk, mesdomaines.nu