0

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Could you complete (edit) your own question with the xtml part where you declare the javascript ? And where you are using it ? – VonC Dec 03 '08 at 07:26

2 Answers2

0

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
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

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

<body onload="">
miceuz
  • 3,327
  • 5
  • 29
  • 33