Script to hide Javascript from Netscape 4*

They have: 54 posts

Joined: Oct 2001

Hello all.

I'm building a Coldfusion site and have come across a nasty problem when testing it in NN4.7 where text on the page is replaced by boxes and symbols - quite often refreshing the page shows the text, but clicking on a link will go back to symbols.

I've managed to determine that the problem is actually the dynamic menu I'm using on the site (DHTML which includes a DIV layer), however, the problem only occurs in .cfm pages on NN4 - not in normal html pages. The menu shows up fine in the .cfm pages, but removing it removes the problem of the other text being affected.

So, as I'd like to keep the menu, I'm looking for a script which will hide the menu script from NN4 browsers and show the text instead (or something similar).

Can anyone offer anything nifty?

Thanks!

Bug x

dk01's picture

He has: 516 posts

Joined: Mar 2002

I guess you might be able to work something out using:
if(document.layers) {
// Netscape 4 code here
}

Even if you only put in a redirect in there it would still stop netscape from displaying the div bar.
-dk

They have: 447 posts

Joined: Oct 1999

are you insistent on making this work in NN4? i dont think supporting NN4 is all that important, very very few people use it and if they do use it theyll have alot of trouble browsing many pages besides yours.

Busy's picture

He has: 6,151 posts

Joined: May 2001

Rob, I think the number of people using NS4.7 would suprise you,I for one still use it and perfer it over NS7, Mozilla 1.0 and IE (opera is first equal). A lot of schools and gov dept and internet cafes still use NS4.x because it is secure, solid, loads pretty fast and works well, unlike IE which has alsorts of issues. People have beentrying to rid teh net of NS4.x for years, it wont happen in a hurry as it is very reliable and not alot else out there is (that you dont have to update every 2 weeks).

Sparklebug have you tested the menu in NS6 ? NS6 is nasty on some DHTML

They have: 447 posts

Joined: Oct 1999

Busy, I think the number of people using Windows 3.1 would suprise you,I for one still use it and perfer it over Windows NT, 2k and XP (Win98 is first equal). A lot of schools and gov dept and internet cafes still use Windows 3.1 because it is secure, solid, loads pretty fast and works well, unlike ME which has alsorts of issues. People have beentrying to rid teh net of Windows 3.1 for years, it wont happen in a hurry as it is very reliable and not alot else out there is (that you dont have to update every 2 weeks).

-- It's time to stop worrying about supporting NN4. It has the worst javascript engine ever which pretty much uses it's own 'javascript like' language, and shouldnt be expected to be supported. also it's not as gravy as you make it sound.

They have: 447 posts

Joined: Oct 1999

also, developers can't work towards a standard if the users refuse to adapt.

They have: 54 posts

Joined: Oct 2001

I found a solution and it seems the problem is not Javascript related afterall - it's due to Coldfusion using the Unicode character set (UTF-8) by default, which NN4 has a lot of trouble with.

So I simply insterted this code into my application.cfm and now it's all peachy:

Interesting points about NN4 - I'm doing this as a study project and the site must be compatible for 98% of users. I think there's still about 3-4% of users still on NN4 so I had to get it to work. For private projects I really don't think I'd bother, to be honest.

Thanks for the advice!

Bug x

Busy's picture

He has: 6,151 posts

Joined: May 2001

glad you found the solution Sparklebug, good luck on your project

Quote: Originally posted by R0B
also, developers can't work towards a standard if the users refuse to adapt.

Wouldn't it be nice if all browsers worked on the same standards. Have to get the browsers working together before the developers can start.

A lot of developers still live in the dark age anyway, coding HTML 4 for IE only, rely on flash for sites even thou flash has become hated from abuse (same as frames, blink, marquee ...). You surf around the net with Opera6 (as opera6) and see how many sites wont even display, and it's suprises how many pro sites that wont work and opera is pretty well conformed to the standards.

I think it just comes down to personal prefence what you use or code for

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Busy, the browsers have agreed on some core standards. N4.x has been replaced by N6, and now N7 to meet just that requirement.

IE6.

Opera6 (which may not work with site not because the code is bad but because Opera does not comply with the DOM standards yet, just the HTML/XHTML/CSS standards, but they are working on it).

N7 is just as secure as N4.x, if not more secure, and more stable.

Personal preference is valid for browsing, but not for coding. It is time to put N4.x aside as the primary browser.

There are many ways to make sites reasonable in N4.x without sacrificing the current standards.

http://www.realworldstyle.com/

Busy's picture

He has: 6,151 posts

Joined: May 2001

for viewing = I had NS6 - didn't like it, have NS7 -perfer NS4.7, Have Mozilla1.0 - don't really like it, have IE5 - don't mind it, have Opera - don't mind it (apart from the annoying banners).

for coding = IE allows sloppy code, Opera sticks on caching same as NS7 but opera offers online validation, don't like the feel of Mozilla so perfer NS4.7, only thing I don't like about NS4.7 is the view source style

Only some of the browsers support some of the things, IMO I doubt they will all conform to them within the next two versions, but wouldnt be suprised if Microsoft was wiped out of the market.

Thanks for the link but that site doesnt display properly in IE5, the top heading is covered by the picture and the three colum example overlaps in NS4.7 but the main page is actualy better in NS4.7

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

You should provide feedback to the site creator on that -- he's been testing it heavily and your set up may be unique.

Busy's picture

He has: 6,151 posts

Joined: May 2001

Good idea, I'll ask him if he wants screen shots

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.