Click to See Complete Forum and Search --> : window.open vs target=_blank


dmartinez
08-05-2003, 09:47 PM
This works but I thought that javascript dictates using a window.open call...

<input type=submit value="Health Check"
onclick='action="/cgi-bin/check2_cti.cgi"' target=_blank>

when i used onclick='action="window.open(/cgi....) it doesnt work so i assume i am putting things in their proper place...it works but i want to learn the proper jscripting conventions..

thanks!

piersk
08-06-2003, 03:38 AM
try:onClick="window.open('/cgi'...) instead

dmartinez
08-06-2003, 07:16 PM
Thank u that worked! I just had it stuck in my mind that i needed the word action in there because it did not deal with an url.

pyro
08-06-2003, 09:18 PM
You could also use something like this, which will keep your pages accessable to those without javascript enabled:

<form action="http://www.w3c.org" method="post" target="_blank">
<p><input type="submit" value="Load Page"></p>
</form>

piersk
08-07-2003, 03:25 AM
True, but that comes up with a big ol' ugly button (yes I know you can change the colour and the like using css).

pyro
08-07-2003, 07:11 AM
Yes, but the original example uses a button. I personally would choose to use a regular link...

piersk
08-07-2003, 07:12 AM
Sorry, didnt notice that. My bad.