Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Javascript & Netscape4 Problem

Need a Solution



4:18 am on Feb 24, 2003 (gmt 0)

10+ Year Member

I'm still a novice when it comes to writing Javascript. I've tried changing this code several different ways and I just can't get it to work in Netscape 4 so I would appreciate any suggestion you might have. It does work in the textbox area for IE6 and NN6.

function messages(adviceNumber) {
//document.FORM1.getElementById("adviceBox").value = helpers[adviceNumber];
//document.layers.FORM1.adviceBox.value = helpers[adviceNumber];
MM_findObj("adviceBox").value = helpers[adviceNumber];

Thanks in advance for your help.



4:31 am on Feb 24, 2003 (gmt 0)

10+ Year Member

I don't use javascript that much, but maybe you could try the following:

change your function header so that you pass the form along like so:

function messages(yourForm, adviceNumber) {

and change the value like so:
yourForm.adviceBox.value = helpers[adviceNumber];

now you'd need to change the function calls wherever they are to something like this:

messages(FORM1, adviceNumeber)

hope that helps



9:46 am on Feb 24, 2003 (gmt 0)

10+ Year Member

Had a similiar problem before. Something to with referencing and casting. I would try spliting up your assignment into

function messages(adviceNumber) {
var ab=0;
ab = MM_findObj("adviceBox");
ab.value = helpers[adviceNumber];

Test it in NN4/Morizilla, if it doesn't work type,
in the address bar, this opens up a console that may help with debugging.



8:40 pm on Feb 24, 2003 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

getElementbyID doesn't work in Netscape 4.X (AFAIK)

It's one of the main reasons I stopped supporting Netscape 4.X.

There are a whole host of other issues with NN 4.X,including a completely different interpretation of the DOM from IE.

With IE being the leading browser I decided that NN needed to change rather than me change, and with NN 7, the DOM resembles that of IE.


3:38 am on Feb 25, 2003 (gmt 0)

10+ Year Member

Thanks for all your help, I really appreciate it. I've found out that NN4 doesn't support mouseover event handling in the texarea box. I'll have to find a different solution. Thanks for trying. :)



10:37 pm on Feb 25, 2003 (gmt 0)

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Equivalent to document.getElementById() in older browsers:

document.layers['id'] = NN4
document.all['id'] = IE4


Featured Threads

Hot Threads This Week

Hot Threads This Month