470,849 Members | 1,259 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

Getting a line to be written in Netscape 4.8

I can get a source file to write html code fully in Iexplorer. However, in
Netscape 4.8, I cannot get it to write this particular line: <SCRIPT
LANGUAGE="JavaScript" SRC="src1.js"></script> in the code. All other lines are
written. Is there some trick I need to do?

The script file src1.js :

function selectFile() {
var pdbFile = 'file:///' + document.form1.fileN.value;
document.writeln('<html>');
document.writeln('<head>');
document.writeln('<title>Chime Viewer</title>');
document.writeln('<SCRIPT LANGUAGE="' + 'JavaScript' + '" SRC="' + 'src1.js'
+'"></script>');
//document.writeln('<SCRIPT LANGUAGE="JavaScript" SRC="src1.js"></script>');
document.writeln('</head>');
document.writeln('<body>');
document.writeln( pdbFile );
document.writeln( '<br>' );
document.writeln('<embed name="mmol" width=500 height=500 startspin=False
spiny=20 ')
document.writeln(' src="' + pdbFile + '" ')
document.writeln('type=application/x-spt script="wireframe 25; ')
document.writeln('spacefill 85; zoom 150" color2d=black bgcolor2d=black >
</embed>');
document.writeln('<form name=form1>');
document.writeln('<input type=file name="fileN">');
document.writeln('<input type=button onClick="selectFile()" value="Open
File">');
document.writeln('</form>');
document.writeln('</body>');
document.writeln('</html>');
document.close()
}

===========================
Thanks,
Jeff
Jul 20 '05 #1
9 1416


JeffFinnan wrote:
I can get a source file to write html code fully in Iexplorer. However, in
Netscape 4.8, I cannot get it to write this particular line: <SCRIPT
LANGUAGE="JavaScript" SRC="src1.js"></script> in the code. All other lines are
written. Is there some trick I need to do?


If that is inline code (code embedded in a HTML page) then you need
document.write('<script type="text/javascript" src="src1.js">' +
'<\/script>');
otherwise the parser will think the </script> closes the containing
<script> element.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
>If that is inline code (code embedded in a HTML page) then you need
document.write('<script type="text/javascript" src="src1.js">' +
'<\/script>');
otherwise the parser will think the </script> closes the containing
<script> element.


==================================
Martin,

Thanks for the quick response. I tried this and it shows up nicely in IExplorer
but not Netscape still. Everything else shows up.

Jeff
Jul 20 '05 #3


JeffFinnan wrote:
If that is inline code (code embedded in a HTML page) then you need
document.write('<script type="text/javascript" src="src1.js">' +
'<\/script>');
otherwise the parser will think the </script> closes the containing
<script> element.

Thanks for the quick response. I tried this and it shows up nicely in IExplorer
but not Netscape still. Everything else shows up.


Are you getting any errors in the Nescape JavaScript console?
Open that by typing
javascript:<enter>
in the location bar and check whether there are any errors.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #4
>Are you getting any errors in the Nescape JavaScript console?
Open that by typing
javascript:<enter>
in the location bar and check whether there are any errors.


=====================
Martin,

No errors are showin up. Here is what the source likes after running the scipt:

<BASE HREF="file:/C|/My Documents/JavaSTest/">
<HTML>
<HEAD>
<TITLE>Chime Viewer</TITLE>
</HEAD>
<BODY>
file:///C:\My Documents\JavaSTest\mmol.pdb
<BR>
<EMBED name="mmol" width=500 height=500 startspin=False spiny=20
src="file:///C:\My Documents\JavaSTest\mmol.pdb"
type=application/x-spt script="wireframe 25;
spacefill 85; zoom 150" color2d=black bgcolor2d=black > </EMBED>
<FORM name=form1>
<INPUT type=file name="fileN">
<INPUT type=button onClick="selectFile()" value="Open File">
</FORM>
</BODY>
</HTML>
===========

One other thing different I now notice is the very first line:

<BASE HREF="file:/C|/My Documents/JavaSTest/">

does not appear in the rewritten source in IExplorer.

Thanks,
Jeff

Jul 20 '05 #5


JeffFinnan wrote:

No errors are showin up. Here is what the source likes after running the scipt:

<BASE HREF="file:/C|/My Documents/JavaSTest/">
<HTML>
<HEAD>
<TITLE>Chime Viewer</TITLE>
</HEAD>


Are you just testing from the local file system or is that necessary for
your application? In my tests Netscape 4 loads the external JavaScript
src in the document.written HTML as soon as the whole things is loaded
via http: URL and not file: URL.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #6
>Are you just testing from the local file system or is that necessary for
your application? In my tests Netscape 4 loads the external JavaScript
src in the document.written HTML as soon as the whole things is loaded
via http: URL and not file: URL.


=======================
Martin,

Yes, I want to load local pdb files into this plugin for view molecules.
Jeff
Jul 20 '05 #7
I notice that in Netscape 7 it rewrites the code fine also like IExplorer.
Unfortunately, this plugin does not work in the higher Netscapes.
Jul 20 '05 #8


JeffFinnan wrote:
Are you just testing from the local file system or is that necessary for
your application? In my tests Netscape 4 loads the external JavaScript
src in the document.written HTML as soon as the whole things is loaded
via http: URL and not file: URL.
Yes, I want to load local pdb files into this plugin for view molecules.


I am not sure that will work with Netscape 4, it seems to insist on not
to load the script file in the document.written HTML (as long as loaded
via file: URL). Using frames where the JavaScript is statically included
in a frameset and you only document.write a frame's content which then calls
top.functionName()
to access functions in the script file should be a workaround.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #9
>Documents\JavaSTest\mmol.pdb


</EMBED><FORM name=form1><INPUT type=file name="fileN"><INPUT type=button
onClick="selectFile()" value="Open File"></FORM>
===========


====================
I notice that not all of what I had pasted in before is showing up in the
posts. This line with some periods added (to hopefully show the line) shows up
as the very first line in Netscape 4.8:

<.BASE HREF="file:/C|/My Documents/JavaSTest/".>

Jul 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Skulled2003 | last post: by
2 posts views Thread by Skulled2003 | last post: by
3 posts views Thread by yzzzzz | last post: by
8 posts views Thread by Hal Vaughan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.