Forum Moderators: open

Message Too Old, No Replies

Can anyone tell me what the point of this is please?

In HEAD tag..

         

jackofalltrades

12:13 pm on Jan 3, 2003 (gmt 0)



<!-- Script that generates an random number -->
<!--
var time = new Date();
ordval= (time.getTime());

Any ideas?

JOAT

Grumpus

12:34 pm on Jan 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can't be sure but, I guess it's one of two things:

a) It's not the whole snippet. It generates a random number using the current time as the random seed.

or

b) I USED to be a random number generator, but the designer only used the part of the code that pulls the current time.

G.

jackofalltrades

12:38 pm on Jan 3, 2003 (gmt 0)



<!-- Script that generates an random number -->
<!--
var time = new Date();
ordval= (time.getTime());
//-->
</script>

Thats the whole lot.

So you reckon its just been taken from a larger piece of code?

Why would you have that in the head tag?

Trick the freshbot into thinking its been updated? Against TOS?

JOAT

korkus2000

12:40 pm on Jan 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is used anywhere else in the document? It may be part of an include and used on specific pages and not the one you are looking at.

jackofalltrades

12:46 pm on Jan 3, 2003 (gmt 0)



Hmm...cant see any references to it on the same page and the same code appears (AFAIK) on all the pages.

On further inspection it appears on related sites (cut and paste template efforts). The code must just have been left in.

The other site displays the current date.

So whats the deal with the random number and date then? Why do it?

Cheers for the help all.

JOAT

chiyo

12:52 pm on Jan 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



way off guess..

a misguided attempt to attract freshbot or reduce duplicate looking pages?

jackofalltrades

1:01 pm on Jan 3, 2003 (gmt 0)



That was my first thought too.

I take it theres no technical (ie legitimate) purpose for having it there then?

Cheers folks

JOAT

korkus2000

1:06 pm on Jan 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the variable is not used then there is no technical reason for it. I don't think the comment really is labeling the code below it. I think there was a large chunk of javascript that was removed. I know many people frankenstien codee until you get strange thing like this.

//creates a integer
var intCar
intCar = "string"

People have a way of slowly learning what things do and modifying them but not changing things like comments and variable names.

jackofalltrades

1:12 pm on Jan 3, 2003 (gmt 0)



Ah right! :)

Just a relic from the site the template was cut and paste from then?

Cheers all

JOAT

WibbleWobble

2:32 pm on Jan 6, 2003 (gmt 0)

10+ Year Member



Indeed it does just appear to be an old date insert. Googling it returned numerous js sites and tutorials, that document the functions.
I don't think its a result of either cunning or genius, frankly.