View Full Version : Interaction btw Open offsite links in new window & Tab content script

09-05-2006, 02:37 AM
1) Script Title:
Open offsite links in new window

2) Script URL (on DD):

3) Describe problem:
Well, it's not exactly a problem, but I suppose I would like to know if this is working as designed.

The only instruction I could find about using the script was to put it in the body of the page. I'm using the tab content script for most of the content on the page.
If I put the OOLINW script at the top of the body - it doesn't work
If I put the OOLINW script at the bottom of the body - it doesn't work
If I put the OOLINW script inside one of the tab content divs - it works perfectly, and it works in all tab content "pages".

Any clue why this is happening? It's not super important because the script seems to be working fine, but I was wondering why this behavior was occuring, and giving a heads up you might want to add this behavior as a hint on the description page.



For the example, go to http://www.flyingscool.com/UsingMSFS.htm

09-05-2006, 04:09 AM
It could be difficult to track this down and in fact, the links on your page don't open new windows in Opera or FF, only IE. Rather than continue to puzzle over such matters which, even if resolved, will make your links' targets dependent upon javascript, simply add the appropriate target attribute to each link on your page:

<a href="offsite.htm" target="_blank">Link Text</a>

To save coding, you can use the base target, if most of the links should be targeted, place this in the head:

<base target="_blank">

Once you do that, all links on the page will open in new windows. To get some to open in the same window, use the target attribute for those links:

<a href="onsite.htm" target="_self">Link Text</a>

09-05-2006, 11:42 AM
Hmm... That's interesting. I don't have Opera, but I did test it on Firefox and it seems to work fine on my system.

Are you sure it doesn't work for you? The only page I have used the script on is http://www.flyingscool.com/UsingMSFS.htm.

I was hoping the script would work because there are sooo many links on this page managing all the target= is a nightmare.



09-06-2006, 12:59 AM
As a further note: I had somebody else test the page as well. At first, it didn't work for him, but after the first try, it did, and kept on working.

Then, I opened a FF window, and it didn't work for me on my first click (it had been working fine for me). I opened another window, and it worked for me, and it has worked since no matter what I do.

It makes management of my links so much easier, I think I'll stick with it. Opera users are a very small percentage of my hits.