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

netscape 4, modify html

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

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


P: n/a
In article <11**********************@f14g2000cwb.googlegroups .com>,
bu****@hotmail.com says...
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?

--
Hywel http://kibo.org.uk/
I do not eat quiche.
Jul 23 '05 #2

P: n/a


bu****@hotmail.com wrote:
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.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #3

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

Jul 23 '05 #4

P: n/a
Correction, hiding it in mozilla doesnt make it quiet.
bul...@hotmail.com wrote:
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 .


Jul 23 '05 #5

P: n/a


bu****@hotmail.com wrote:
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>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.