By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,665 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
jo**********@dgs.ca.gov wrote:
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.
Jul 23 '05 #2

P: n/a
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

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.