js document.write() includes & Netscape 4.x

J

john.kwasnik

Hi, all --

I have several pages which use the same components over and over; I'd
like to do these components as includes. I can't do server-side stuff
with my ISP, so I thought I would use client-side javascript: a series
of 'document.write()' statements to build the HTML fragment.

This works just great in most browsers ... but Netscape 4 doesn't seem
to like them. Sometimes the page doesn't display at all. Sometimes it
stops loading where the include gets read. The behavior is erratic and
inconsistent; the same page may render sometimes and sometimes not, or
will when 'refresh' is hit.

I've tested with 4.08, 4.7, and 4.79 ...

Tried both defining js functions in the <head>, and loading external js
files in the <body> ... same results. Example here:

http://members.accessbee.com/jkwasnik/green/green.html
Anyone know a work-around?

Thanks much,

John
 
R

Richard Cornford

I have several pages which use the same components over and
over; I'd like to do these components as includes. I can't
do server-side stuff with my ISP, so I thought I would use
client-side javascript: a series of 'document.write()'
statements to build the HTML fragment.
<snip>

Bad plan. Look into HTML pre-processors, they can save you all the work
and produce reliable results.

Richard.
 
J

john.kwasnik

Richard --

Thanks. But in this case, all I can use are client-side means.

I have solved the problem, however.

Jonathan Little (http://www.LittleWorksStudio.com) pointed out a quirk
in Netscape 4.x -- using a 'style=' attribute in document.written tags
is iffy. Netscape was REPEATING the lines with such tags, but
corrupting the attribute to 'Ttyle=' ... this left an un-closed <div>,
and the page stopped rendering. Removing 'style=' from all the
document.written tags in my includes solved the problem.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top