It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

getTimezoneOffset issue

getTimezoneOffset issue

Postby deluxmilkman on Thu Sep 27, 2007 4:39 pm

i wrote this to change my embedded swf depending on the location,
but it's not working.
it also disable other javascript on the page.

[HTML]
myDate = new Date();
myTD = myDate.getTimezoneOffset();
if ((myTD >= 180) && (myTD < 480)){
document.mySWF.src="alaska.swf";
}else if((myTD >=1 80) && (myTD < 180)){
document.mySWF.src="england.swf";
}else if((myTD >= -540) && (myTD < -180)){
document.mySWF.src="japan.swf";
}else{
document.mySWF.src="hawai.swf";
}

[/HTML]

thanx for your help.
deluxmilkman
 
Posts: 8
Joined: Wed Sep 26, 2007 3:15 pm

Postby bobbyblades on Thu Sep 27, 2007 7:52 pm

I think this
else if((myTD >=1 80)

should be this:
else if((myTD >=180)




theres a space between the 1 and the 80 which is screwin up the script
User avatar
bobbyblades
50+ Club
 
Posts: 85
Joined: Fri Aug 24, 2007 8:38 pm
Location: hawaii or bust


Who is online

Users browsing this forum: No registered users and 7 guests