473,785 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
2 1369
jo**********@dg s.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
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.writte n 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.writte n tags in my includes solved the problem.

John

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4524
by: 2obvious | last post by:
This is a pipe dream, I realize, but I'm trying to emulate the functionality of the W3C DOM-supported document.getElementsByTagName method under the very nightmarish Netscape 4. Through some sleuthing, I was able to find what serves as a document.getElementById emulator at http://www.xs4all.nl/~ppk/js/dhtmloptions.html#versionb. (Below is the code; this clever algorithm is painstakingly explained at the site above.)
4
2766
by: Yvan J. Gagnon | last post by:
I am encountering a strange problem in Netscape 7 with a CFM file I am trying to troubleshoot (the page is working fine in NS Communicator and IE). Below is a sample of the problematic line of javascript code. Note that in the actual file, I've surrounded the variable '#cookie.cookiename#' with CFOUTPUT tags: document.write('<input type="Hidden" name="affiliate" value="#cookie.cookiename#">'); When I load the document in Netscape 7, I...
1
2221
by: nickolausp | last post by:
When embedding a JavaScript document.write within a JavaScript document.write in Netscape 4.x (example below), the text is written out of logical order. <script type="text/javascript"> <!-- document.write('<script type=\"text/javascript\">document.write(\'111\');<\/script>222'); document.write('333'); //-->
6
6846
by: David List | last post by:
I'm having a problem using different properties of the document object in the example javascripts in my textbook with browsers that identify themselves as using the Mozilla engine. One example of these problems is using document.layers. I have Google'd for examples of how to use the document object specifically with Mozilla, but I cannot find anything that explains why my problems occur. Could anyone here see through the included example...
3
9843
by: Catherine Lynn Smith | last post by:
I am creating a webpage with dhtml <DIV> layers and I want a link on one layer to modify the content on another but I seem to keep running into errors. Basically I create a layer in the middle of the screen that initially comes up with a gif image of a house: <!-- start "house" layer definition for center of screen --> <DIV id="house" style="position:absolute; left:140px; top:137px; width:510px; height:325px; z-index:2"><img...
4
11765
by: Geoff Wilkins | last post by:
I must confess I only come here when I have a problem - so my apologies if this has been raised before: Using my IE v.6 browser, document.write doesn't convert HTML entities (e.g. &apos;, &amp;) to the appropriate character (though NS 6.2 works fine). Obviously I can get round this for particular entities by writing some code to do the conversion before using document.write - but I need a more general solution that will catch any of the...
10
54906
by: InvisibleMan | last post by:
Hi, Thanks for any help in advance... Okay, I have the JS listed below that calls for the display of the (DIV) tag... cookie function not included, as don't feel its necessary but you'll get the idea! function closeall() { var objs;
5
1750
by: s_m_b | last post by:
function saveState() { document.write (" | <a href = 'myhomepage.asp? view=mhp&amp;action=save&amp;pb="); >> document.write (document.phone.style.display.value); document.write ("'>save view</a>"); }; creates an error at this (>) line.
2
2068
by: Monte Gardner | last post by:
At my company, we have a javascript function that uses document.write() calls to create an INPUT tag with type set to "image". The image that it is downloading comes from a dynamic image server, so it has lots of stuff in the query string, including ampersands. The image that I'm getting in my web page as a result of this call is not configured correctly. After some investigation, I've found that the document.write() call seems to be...
0
10327
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8973
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.