Forum Moderators: mack

Message Too Old, No Replies

Help! My script wont work!

         

JasonJJT

4:20 pm on Aug 13, 2003 (gmt 0)

10+ Year Member



Hi, I am trying to get my script to work for a daily quote that changes (javascript).

For some strange reason it will not work, and it says undefined.

Please help asap!
Thank you very much

[edited by: JamesR at 9:58 pm (utc) on Aug. 13, 2003]
[edit reason] please, no personal URLs in threads [/edit]

claus

4:40 pm on Aug 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Jason it's against the WebmasterWorld TOS (Terms of Service) to post your own urls so the link will probably be deleted soon.

Could you please post the part of your javascript that doesn't work in stead, along with a description of what you would like it to do and which part that doesn't do as you would like it ot?

/claus

BTW: Welcome to WW :)

MonkeeSage

5:01 pm on Aug 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Jason:

Two problems I can see:

1. You want getDay(), I think, which will give you 1-7 (i.e., Mon-Sun), not getDate() which gives you the calander day (i.e., 13 for today).

2. There is no 13th item in your array yet (only 2), so it is undefined when it tries msg[today] (=msg[13]).

HTH
Jordan

MonkeeSage

5:06 pm on Aug 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



var msg = new Array();
var Stamp = new Date();
// var today = Stamp.getDate();
var today = Stamp.getDay();
msg[0] = "";
msg[1] = "Hey this is the first tip";
msg[2] = "And this is tip 2!";
msg[3] = "And this is tip 3!";
msg[4] = "And this is tip 4!";
msg[5] = "And this is tip 5!";
msg[6] = "And this is tip 6!";
msg[7] = "And this is tip 7!";

Ps. You should also change this:
trUnder = window.open(...

to

var trUnder = window.open(...

or else it gives warning about assigning a value to an undeclared variable.

Jordan

JasonJJT

12:39 am on Aug 14, 2003 (gmt 0)

10+ Year Member



Thanks Jordan,

I changed everything you said to, but I can't find

trUnder = window.open(...

I dont see that at all?
Please help
Thank you