views:

40

answers:

2

Javascripts are in script.js file which I have called in the xhtml file.

But it is throwing error at line where I have calling onpageload function saying " object expected.

However, if I have the scripts on same XHTML file, it is working fine.

A: 

As specified in HTML4 specifications for Scripts, do you declare your external javascript like this ?

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

IE (but other browers may too) requires that you open and close the script tag.
The end tag of the `script' element is not optional

VonC
A: 

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

<body onload="">
miceuz