netscape 4, modify html

B

bulk88

I know Netscape 4 is Ancient and horrible but I need to make my site
Netscape 4.8 compatible. But how can I rewrite HTML code/do minor DTHML
on my site with Netscape 4/4.8, document.write works, but I cant remove
anything with it. Mostly what I need to do is remove/disable a embed or
object tag if a user clicks a button, and write it back in if they
click another. IE 4's DOM is so so so so much better and so much more
Dom Level 1.
 
H

Hywel Jenkins

I know Netscape 4 is Ancient and horrible but I need to make my site
Netscape 4.8 compatible. But how can I rewrite HTML code/do minor DTHML
on my site with Netscape 4/4.8, document.write works, but I cant remove
anything with it. Mostly what I need to do is remove/disable a embed or
object tag if a user clicks a button, and write it back in if they
click another. IE 4's DOM is so so so so much better and so much more
Dom Level 1.

What about hiding stuff in <layer></layer> and toggle its visibility
using the document.layers collection?
 
M

Martin Honnen

I know Netscape 4 is Ancient and horrible but I need to make my site
Netscape 4.8 compatible. But how can I rewrite HTML code/do minor DTHML
on my site with Netscape 4/4.8, document.write works, but I cant remove
anything with it. Mostly what I need to do is remove/disable a embed or
object tag if a user clicks a button, and write it back in if they
click another.

Frankly if you do not have a clue about NN 4 and are building a web site
now then make it NN 4 compatible by serving static HTML to NN 4 with
script for DOM browsers with appropriate checks so that NN 4 users do
not get script errors.
That way the site works for NN 4 users, even if dynamic effects are not
there.

The only thing that Netscape 4 can do dynamically besides scripting
forms is the manipulation of the visibility, clipping, background, and
complete content of what it sees as layers.
Thus if you have CSS

<style type="text/css">
#embedLayer {
position: relative;
}
</style>

and HTML

<div id="embedLayer">...</div>

then in NN 4 you can hide that div using

var layer;
if (document.layers && (layer = document.layers.embedLayer)) {
layer.visibility = 'hide';
}

But the div is only hidden then, no reflow happens (as would in modern
browsers if you scripted the CSS display property) so whatever layout
space the div had is now simply an empty block.
 
B

bulk88

Hiding a Windows Media Player instance doesnt make it quiet (except in
Mozilla), I guess I'll just have to do browser detection and hard code
for WMP and use LiveConnect .
 
M

Martin Honnen

Hiding a Windows Media Player instance doesnt make it quiet (except in
Mozilla)

You can clear the complete content of a layer in NN 4 as follows:

<html lang="en">
<head>
<title>rewriting a layer in NN 4</title>
<script type="text/javascript">
function clearLayer (layerId) {
var layer;
if (document.layers && (layer = document.layers[layerId])) {
layer.document.open();
layer.document.write('');
layer.document.close();
}
}
</script>
<style type="text/css">
#embedLayer {
position: relative;
}
</style>
</head>
<body>
<div id="embedLayer">
<p>Kibology for all.</p>
</div>
<p>
<a href="#"
onclick="clearLayer('embedLayer'); return false;">clear</a>
</p>
</body>
</html>
 

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

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top