Welcome to WebmasterWorld Guest from 54.227.214.52

Forum Moderators: open

js window.open()

Can't get it to work

   
3:01 pm on May 4, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could anyone tell me why this window will not open up for me. I formatted it exactly how it was shown on a Goodies tutorial, but it just reloads the same page. Here's the line:

<a class="bodylink" href="bvc001.html" onClick="window.open('http://www.mysite.com/tiaras.html','Shipping details', config='height=300,width=300')">click here.</a>

Appreciate the help!

3:05 pm on May 4, 2002 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member




1) remove the word "config" from your features section of the function.

2) You wouldn't need the link in the href section. You can use a href="#" . Generally the onClick will override the href link, but it never hurts to be sure.

Other than that it should work.

3:10 pm on May 4, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks again txbakers! You hooked me up yesterday too. Gotta love WW.
3:18 pm on May 4, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Now I'm getting error "invalod arguement"

<a class="bodylink" href="#" onClick="window.open('http://www.mysite.com/tiaras.html','Shipping details','height=300','width=300')">click here.</a>

3:46 pm on May 4, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



The second argument is the window name - it should not contain a space. Use something like 'shipping_details'
11:48 am on May 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



also your window features should be passed as a single string parameter:

<a class="bodylink" href="#" onClick="window.open('http://www.mysite.com/tiaras.html','Shipping_details','height=300,width=300')">

Make sure you don't have a space in the features string (blue above) or it won't work in NN4.

4:25 am on May 6, 2002 (gmt 0)

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Even better is to do this:

<a class="bodylink" href="javascript:window.open('http://www.mysite.com/tiaras.html','Shipping_details','height=300,width=300');">

 

Featured Threads

Hot Threads This Week

Hot Threads This Month