Javascript|Programmering / Grafisk formgivning|Forum|Nordichardware

Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
The forums are currently locked and only available for read only access
sp_Feed sp_TopicIcon
Javascript
Bleedin Radar
Kommer du hit ofta?
Medlem
Forum Posts: 508
Member Since:
November 4, 2001
sp_UserOfflineSmall Offline
1
October 5, 2002 - 2:40 pm
sp_Permalink sp_Print

Detta script fungerar varken i Netscape eller Opera:


function getWeek(){
var now = new Date();
var ny = new Date(now.getYear(),0,1);
var wd = ny.getDay();
if (wd == 0) { wd = 7 }
var days = Math.floor((now-ny) / (1000*60*60*24));
days += (7 - wd);
wd = now.getDay();
if (wd == 0) { wd = 7 }
days -= wd;
wnr = Math.floor(days / 7)+1;
return wnr;
}

Internet Explorer returnerar wnr = 44
Opera/Netscape ungefär wnr = 99177

Hur fixar man det så det funkar i mer än IE?

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1030
Currently Online:
Guest(s) 51
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Andreas Galistel: 16287
Jonas Klar: 15897
ilg@dd: 10810
Nyhet: 10607
Mind: 10550
Ctrl: 10355
Gueno: 9881
Guest: 9344
Snorch: 8881
Callister: 8468
Newest Members:
PetrbonFU PetrbonFU
Karine Bembry
Dolores Mcdaniels
Anibal McLeish
Francisca Alt
Alfie Everhart
Lester Huitt
Orlando Jorgensen
Mikki Lundgren
Dakota Kozlowski
Forum Stats:
Groups: 11
Forums: 59
Topics: 146630
Posts: 1300967

 

Member Stats:
Guest Posters: 2
Members: 79425
Moderators: 0
Admins: 11
Administrators: nordicadmin, Henrik Berntsson, Anton Karmehed, Carl Holmberg, Joel Oscarsson, Mikael Linnér, Mikael Schwartz, Andreas Paulsson, Nickebjrk, Mattias Pettersson, EmxL