View Full Version : Open offsite links in new window

02-05-2005, 04:00 AM
Wanting to use this script -

trying to edit the script to allow for the use to get the choice.
I change the following as instructed:

//1)Enter domains to be EXCLUDED from opening in new window:
var excludedomains=["hodesnauser.com", "skipped.com"]

//2)Automatically open offsite links in new window? (1=yes, 0 will render a checkbox for manual selection)
var auto=0

However when I do this and try and click the button I get the following error:

"Error: 'mydomain' is undefined."

It is referencing this line -
if (document.links[i].hostname.indexOf(mydomain)==-1)

I changed it to:
if (document.links[i].hostname.indexOf(excludedomains)==-1)

This seems to make it work, but I wanted to verify with others that this is the correct change.

Thanks - WwTIPPYwW