![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Newbie
Join Date: Oct 2004
Posts: 11
Rep Power: 0
![]() |
Whats wrong with this?
Quote:
|
|
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
Your code looks fine, my only suggestion would be to use code like the one i have below to determine if there is anything in the array...
window.onload = function() {
var length = safetyTips.length;
if(length == 0)
document.write("There was an error with the safetyTips array, aborting.");
else
document.write(safetyTips[Math.floor(Math.random()*length)]);
} |
|
|
|
|
|
#3 | |
|
Newbie
Join Date: Oct 2004
Posts: 11
Rep Power: 0
![]() |
Quote:
|
|
|
|
|
|
|
#4 | ||
|
Newbie
Join Date: Oct 2004
Posts: 11
Rep Power: 0
![]() |
Changed it to this ...
Quote:
Quote:
|
||
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|