Click to See Complete Forum and Search --> : Variable determined by host name?


msmith29063
06-17-2003, 07:56 AM
Is this the correct syntax?

// Determine domain used to access site
if (top.location.host.indexOf('.com')) {
var DefaultURL = 'http://www.sitename.com';
}
if (top.location.host.indexOf('.org')) {
var DefaultURL = 'http://www.sitename.org';
}

I need assign this variable based on how the site was accessed -- either .org or .com. Thank you for your help!

msmith29063
06-17-2003, 08:04 AM
Thanks, Dave. I wasn't gonna bug you with this issue. But thanks for the help! You've been great. I've really learned a lot!