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

Convert IE JS to Netscape

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a

"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

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

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