473,386 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 1300

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sims | last post by:
Hi, if i use... // php $info = getenv("HTTP_USER_AGENT"); // I noticed that Mozzila and Netscape <6(?) both use the same Agent. // so i was thinking of if...
1
by: mark.reichman | last post by:
First off.. Thanks to Grant Wagner for help in a previous thread related to this one. I am at a total loss... I have multiple fields in a form with the same name. Lets call the fields with the...
1
by: Jason | last post by:
Could anyone please give me a hand converting this script, written for IE to work with netscape? _________________________________ ______________________________________ <!-- var...
9
by: rez | last post by:
I find it rather frustrating that Netscape 4.x is "no longer supported:" http://help.netscape.com/products/client/communicator/reflib.html Same seems true with IE. How am I ever supposed to...
12
by: Marc | last post by:
I have used XMLDataToString = DataSetForXML.GetXml() to get an XML string from a dataset. I am looking for a way to create a dataset from this XML string. I tried...
15
by: musicmouse | last post by:
In my website (www.classiccat.net) the basic layout consists of two elements: - a centered block that has a fixed with of 720 - a right-aligned Google advertising block. When the visitor has a...
10
by: News | last post by:
I have a page up trying to learn how to ID a browser and other info. http://wyght.com/warren/testPos.html here is the code <script type = "text/javascript"> var space = ", "; var name...
29
by: Jan | last post by:
Hi: I have an Access database that's been running (in one form or another) for a couple of different clients for a few years. Now a new client has requested that it be implemented with a SQL...
4
by: Nathan Sokalski | last post by:
I was testing out a page of mine that displays the information from Page.Request.Browser. It works exactly as I expected in Internet Explorer and Netscape 4.75 (I didn't expect much in Netscape...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.