R
robert.waters
Hello,
When the following page is executed in IE6, it generates script errors
('object expected') for any function that is declared in an external
..js file. Why is this???? This code works in Firefox 1.07 and 1.5.
(The following code, when the body's onload event is triggered, simply
rewrites the page using documentElement.innerHTML)
//------------test.html--------------------
<html>
<head>
<script src="script.js"></script>
<script type="text/javascript">
function rewritePage(){
alert('rewriting the page');
document.write(document.documentElement.innerHTML);
}
</script>
</head>
<body onload="rewritePage();">
generate a script error with document.write
<script type="text/javascript">
isScriptWorking(); // from script.js
</script>
</body>
</html>
//---------script.js-------------
function isScriptWorking() {
alert('script is working');
}
How can I get around this, if this is the method that I have to use?
When the following page is executed in IE6, it generates script errors
('object expected') for any function that is declared in an external
..js file. Why is this???? This code works in Firefox 1.07 and 1.5.
(The following code, when the body's onload event is triggered, simply
rewrites the page using documentElement.innerHTML)
//------------test.html--------------------
<html>
<head>
<script src="script.js"></script>
<script type="text/javascript">
function rewritePage(){
alert('rewriting the page');
document.write(document.documentElement.innerHTML);
}
</script>
</head>
<body onload="rewritePage();">
generate a script error with document.write
<script type="text/javascript">
isScriptWorking(); // from script.js
</script>
</body>
</html>
//---------script.js-------------
function isScriptWorking() {
alert('script is working');
}
How can I get around this, if this is the method that I have to use?