Link to home
Start Free TrialLog in
Avatar of christmann
christmann

asked on

Open window with onClick

I am trying to use this javascript in the onClick for a button, but I receive a syntax error.  What is the best method to launch a new browser from a button?


<a href="#" onClick="MyWindow=window.open('http://www.google.com','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600,left=20,top=20'); return false;">open window</a>

Thanks, Adam
Avatar of HemanthaKumar
HemanthaKumar

It works for me. Just make sure that this html code is a passthru HTML.

~Hemanth
Avatar of christmann

ASKER

Can you explain further.  If I drop this code into the onClick for the button, I do not have the option to mark this as passthru HTML on the Text menu.  As you can tell, I am a little confused.  Thanks
Can you explain further.  If I drop this code into the onClick for the button, I do not have the option to mark this as passthru HTML on the Text menu.  As you can tell, I am a little confused.  Thanks
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That was it.  Thanks for the help.  Adam