I have two scripts running on the same page, but when I load the page, the one that has the alert in it wont work. When I take the other one out, the alert works fine. Why is this?
Here is the code.
alert:
Code:
window.onload = construction;
function construction() {
alert("This site is still under construction. Some of the links and effects may not work. Still, you can look around.")
}
other one:
Code:
window.onload = timegreeting;
function timegreeting() {
var now = new Date();
var greet;
if (now.getHours() < 11) {
greet = "<p>Good morning!</p>";
}
else if (now.getHours() < 17) {
greet = "<p>Yo!</p>";
}
else {
greet = "<p>Good evening!</p>";
}
document.getElementById("greeting").innerHTML = greet;
}
Thanks!
__________________
function signature() {
document.write("I'm a geek! (duh!)")
}
Last edited by Padawan Geek; 04-12-2007 at 09:25 PM..
|