I am passing the xhtml tag id in onPageLoad ('TableID') function

The Javascripts are in a file script.js

that I called in the xhtml file.

But it is throwing an error on the line where I call a function onpageload

that says "expected object".

However, if I have scripts in the same XHTML file, it works fine.

0


source to share


2 answers


As the HTML4 spec for scripting states , do you declare your external javascript like this?

<script src="external.js" type="text/javascript"></script>

      



IE (but there may be other browsers) requires you to open and close the script tag.
The end tag of a `script 'element is not optional

0


source


make sure you call your scripts after the page has fully loaded - use the document.onload event handler or



<body onload="">

      

0


source







All Articles