Connecting Tech Pros Worldwide Forums | Help | Site Map

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

john.kwasnik@dgs.ca.gov
Guest
 
Posts: n/a
#1: Jul 23 '05
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


Richard Cornford
Guest
 
Posts: n/a
#2: Jul 23 '05

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


john.kwasnik@dgs.ca.gov wrote:[color=blue]
> 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.[/color]
<snip>

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

Richard.


john.kwasnik@dgs.ca.gov
Guest
 
Posts: n/a
#3: Jul 23 '05

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


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

Closed Thread


Similar JavaScript / Ajax / DHTML bytes