Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > window.open not working for me...

window.open not working for me...
Thread Tools
Fresh-Faced Recruit
Join Date: Jan 2001
Location: England
Status: Offline
Reply With Quote
Feb 8, 2006, 07:14 AM
 
Can anyone help with the following:

I am successfully using the window.open code to open a new window from a text hyperlink. The code used is:

<p><a href=""onClick="window.open('archive.html', 'newWnd','width=600,height=500,toolbar=0,status=0, scrollbars=0,resizable=0'); return true;">click here</a></p>

This new window (archive.html) contains an image hyperlink to another new window. The code used is:

<a href=""onClick="window.open('portfolio1.html', 'newWnd', 'width=600,height=500,toolbar=0,status=0,scrollbar s=0,resizable=0'); return true;"><img src="images/thumbnail1.jpg" width="107" height="80" alt=""></a>

However this does not seem to work. Can anyone suggest where I have wandered off the path of righteous code?

Thanks for all help in advance...

Julian
     
Fresh-Faced Recruit
Join Date: Feb 2006
Location: Indianapolis
Status: Offline
Reply With Quote
Feb 8, 2006, 10:20 AM
 
Kinda hard to tell with just that...are you getting any javascript errors?
     
Fresh-Faced Recruit
Join Date: Jan 2001
Location: England
Status: Offline
Reply With Quote
Feb 8, 2006, 11:24 AM
 
It's kind of hard to explain it better...no javascript errors reported.

If window 2 opens from window 1 (parent), window 3 won't open from window 2. It just stutters on window 2.

But if I open window 2 independently, I can then open window 3.

Mmm...still with me?
     
Fresh-Faced Recruit
Join Date: Feb 2006
Location: Indianapolis
Status: Offline
Reply With Quote
Feb 8, 2006, 12:10 PM
 
Try changing the window name ("newWnd", the second arguement) on the new window, it needs to be unique for different windows. It could be looking at the same window. Try 'archive' in the first script and 'portfolio' in the second script. If its in a script used by many windows, and you need to keep it the same value for some reason, trying calling it "_blank".
     
Fresh-Faced Recruit
Join Date: Jan 2001
Location: England
Status: Offline
Reply With Quote
Feb 9, 2006, 04:15 AM
 
Thanks popfilter. This has worked a treat. Hurray for MacNN!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:28 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2