bbruggemeyer
Programmer
Hi all
I am using an external .js file to dynamically link several more .js files into an HTML page.
The problem occurs with Netscape 4.x browsers. It seems to work fine in the majority of cases but on some pages the Netscape parser has a problem half way through the main HTML page and throws an error. In all cases the code snippet in the debug window is different to the actual code visible when you view source.
HTML page includes
all_code.js includes
example of error
Line from view source
The actual error displayed is irrelevant as it changes depending on the amount of code which precedes it in the main HTML page. However, in all cases the type of error occurring suggests that a line-feed may have been inserted in the middle of the code. (I can move the position of the error by padding the code above it with spaces. If I push it towards a legal position (i.e. outside of a string and not in the middle of a variable or object reference) everything seems OK!
Anyway, this thing is driving me round the bend so any suggestions would be very welcome and could save my sanity.
thanks,
Bill Bruggemeyer
I am using an external .js file to dynamically link several more .js files into an HTML page.
The problem occurs with Netscape 4.x browsers. It seems to work fine in the majority of cases but on some pages the Netscape parser has a problem half way through the main HTML page and throws an error. In all cases the code snippet in the debug window is different to the actual code visible when you view source.
HTML page includes
Code:
<SCRIPT language="javascript" src="all_code.js"></SCRIPT>
<script language="javascript">
<!--
// Page specific javascript, including...
document.title = myTitle.toUpperCase() + " - Summary";
//-->
</script>
all_code.js includes
Code:
document.writeln('<SCRIPT Language="javascript" src="module1.js"></SCR'+'IPT>');
document.writeln('<SCRIPT Language="javascript" src="module2.js"></SCR'+'IPT>');
document.writeln('<SCRIPT Language="javascript" src="module3.js"></SCR'+'IPT>');
example of error
Code:
unterminated string literal.
document.title = myTitle.toUpperCase() + " - Summ
.............................................^
Line from view source
Code:
document.title = myTitle.toUpperCase() + " - Summary";
The actual error displayed is irrelevant as it changes depending on the amount of code which precedes it in the main HTML page. However, in all cases the type of error occurring suggests that a line-feed may have been inserted in the middle of the code. (I can move the position of the error by padding the code above it with spaces. If I push it towards a legal position (i.e. outside of a string and not in the middle of a variable or object reference) everything seems OK!
Anyway, this thing is driving me round the bend so any suggestions would be very welcome and could save my sanity.
thanks,
Bill Bruggemeyer