Home › Forums › JavaScript › external script help › Re: external script help
March 26, 2010 at 2:17 am
#72979
Member
All function calls in javascript (and just about any language you’ll find) require parentheses. Therefore, your line:
Code:
window.onload = writeMessage;
should be written as:
Code:
window.onload = writeMessage();
Also, the line in your HTML file’s internal script:
Code:
document.getElementById(“hello”).innerHTML;
is doing nothing. You don’t have an element with an id of "hello", and even if you did, innerHTML takes the value between the open and close tags and gives it back to you. In this case, you’re not doing anything with it, simply reading it.
I hope this helps.