469,610 Members | 1,554 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,610 developers. It's quick & easy.

Convert IE JS to Netscape

Hi,

I have a nice cascading menu i am trying to get to work in NS.

My intention is to slowly pick through the code converting it function by
function, looking for help here on specifics. Is that a good approach? or
should I post all my code?

For example, for starters The following works in IE, but I don't know how to
port it to NS:

bar[i].onmouseover = new Function("ShowMenu_NAV(" + bar[i].id + ")")
bar[i].onclick = new Function("Do_NAV("+bar[i].id+")")
Can you help me?

Thanx.
Jul 20 '05 #1
3 1222

"Need More Challenge" <no****@bbbbbbbb.com> wrote in message
Hi,

I have a nice cascading menu i am trying to get to work in NS.

My intention is to slowly pick through the code converting it function by
function, looking for help here on specifics. Is that a good approach? or
should I post all my code?

For example, for starters The following works in IE, but I don't know how to port it to NS:

bar[i].onmouseover = new Function("ShowMenu_NAV(" + bar[i].id + ")")
bar[i].onclick = new Function("Do_NAV("+bar[i].id+")")
Can you help me?

Thanx.


I think this should do it for you (havent tested it)... and it will work on
both browsers....

bar[i] = "ShowMenu_Nav(" + bar[i].id + ")";

As a higher level answer, you should try to port IE code to be as cross
platform as possible. There should be very little or no IE specific or NS
specific code when you finish.

B
Jul 20 '05 #2
"Need More Challenge" <no****@bbbbbbbb.com> writes:
I have a nice cascading menu i am trying to get to work in NS.
I'll assume you mean Netscape 6+, not Netscape 4.
My intention is to slowly pick through the code converting it function by
function, looking for help here on specifics. Is that a good approach? or
should I post all my code?

For example, for starters The following works in IE, but I don't know how to
port it to NS:

bar[i].onmouseover = new Function("ShowMenu_NAV(" + bar[i].id + ")")
If "bar[i].id" evaluates to the name "someId", you are creating a
function with the following body:
ShowMenu_NAV(someId)
When evaluated, "someId" is a variable. In IE, named elements creates
a global variable of the same name. Not so in Mozilla/Netscape. You
would want something like:
ShowMenu_NAV(document.getElementById("someId"));
which can be created by:
new Function("ShowMenu_NAV(document.getElementById(\"" +bar[i].id+"\"))")
bar[i].onclick = new Function("Do_NAV("+bar[i].id+")")


ditto.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3
Lee
Brian said:


"Need More Challenge" <no****@bbbbbbbb.com> wrote in message
Hi,

I have a nice cascading menu i am trying to get to work in NS.

My intention is to slowly pick through the code converting it function by
function, looking for help here on specifics. Is that a good approach? or
should I post all my code?

For example, for starters The following works in IE, but I don't know how

to
port it to NS:

bar[i].onmouseover = new Function("ShowMenu_NAV(" + bar[i].id + ")")
bar[i].onclick = new Function("Do_NAV("+bar[i].id+")")
Can you help me?

Thanx.


I think this should do it for you (havent tested it)... and it will work on
both browsers....

bar[i] = "ShowMenu_Nav(" + bar[i].id + ")";


No. Even assuming you meant:
bar[i].onmouseover = "ShowMenu_Nav(" + bar[i].id + ")";
that just assigns the string value, not a Function object.

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jason | last post: by
9 posts views Thread by rez | last post: by
12 posts views Thread by Marc | last post: by
15 posts views Thread by musicmouse | last post: by
10 posts views Thread by News | last post: by
4 posts views Thread by Nathan Sokalski | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.