473,544 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mozilla, innerHTML, and then?

I am doing some maintenance on a js tree control that was done with
proprietary IE code.

When I click on a node it calls a function which has code similar to
that below to expand the tree. "el" refers to the div that I clicked
on.

var workHtml = el.innerHTML;

for (i = 0; i < idx; i++)
{
strHtml = '<div><span onclick=f_Click ("'+ idx +
'")></span></div>';

workHtml = strHtml + workHtml;

}
el.innerHTML = workHtml;
Now, this works, both in IE and FireFox, but in FireFox I get the
"Waiting... "
message in the status bar at the bottom of the frame.

Is there something more I should add? Or should I have used another
approach rather than innerHTML? (I'm replacing the proprietary
insertAdjacentH TML).

Thanks

Jul 23 '05 #1
1 1319


jh*****@yahoo.c om wrote:
I am doing some maintenance on a js tree control that was done with
proprietary IE code.

When I click on a node it calls a function which has code similar to
that below to expand the tree. "el" refers to the div that I clicked
on.

var workHtml = el.innerHTML;

for (i = 0; i < idx; i++)
{
strHtml = '<div><span onclick=f_Click ("'+ idx +
'")></span></div>';

workHtml = strHtml + workHtml;

}
el.innerHTML = workHtml;
Now, this works, both in IE and FireFox, but in FireFox I get the
"Waiting... "
message in the status bar at the bottom of the frame.

Is there something more I should add?
I am guessing but a message in the status bar is not likely to be caused
by some innerHTML change, perhaps you are calling that code from a link e.g.
<a href="javascrip t: functionName()" >
or
<a href="#"
onclick="functi onName();">
and the problem goes away with
<a href="#"
onclick="functi onName(); return false;">
Or should I have used another
approach rather than innerHTML?


If you want to add elements to the el element then you can use the W3C
DOM e.g.
var div, span;
if (document.creat eElement && (div = document.create Element('div')) ) {
span = document.create Element('span') ;
span.onclick = function (evt) { f_Click(idx); };
// maybe you need
// span.onclick = new Function ("evt", "f_Click('" + idx + "');");
// instead, I am not sure what idx is in your snippet
span.appendChil d(document.crea teTextNode('spa n content'));
div.appendChild (span);
el.appendChild( div);
}

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5014
by: Mitch | last post by:
Here is some code I have bastardised from a few places, Obviously the innerHTML coding won't work in Mozilla, could anyone suggest a work around or fix? cheers, Mitch. ****************snip************************* <html> <head> <title>Untitled</title>
10
3568
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script language="JavaScript" type="text/javascript"> function show(that) { if (box.style.visibility=='hidden') { that.style.visibility = 'visible'}; }
1
9025
by: Ted Weatherly | last post by:
Hello, I want to dynamically create a table cell with a textfield in it. The value for the textfield can have quotes. e.g. I have this snippet of javascript code: var td = document.createElement('td'); var cellMarkup = '<input value="&quot;test&quot;">'; td.innerHTML = cellMarkup;
6
5022
by: Red_Indian | last post by:
Hi How do I accomplish the following functionality in Mozilla/ Firefox: document.form.textbox.disabled = false if I want to conditionally enable a text box that was disabled by default. The above code works fine in IE, but doesn't in Mozilla. I have seen somewhere the Mozilla equivalent of the same, but can't quite find it.
4
2524
by: John Bullock | last post by:
Hello, I am at wit's end with an array sorting problem. I have a simple table-sorting function which must, at times, sort on columns that include entries with nothing but a space (@nbsp;). I want all of the spaces to be put in the first slots of the array. IE 6 does this. But Firefox 0.9.1 doesn't, and I don't know why. I have not been...
6
2819
by: hsomob1999 | last post by:
so i have a <ul> and I allow the user to append items to it. The problem is that on mozilla the <span class="line"> which is just a line to divide the sections gets overlaped and doesnt move down and adjust to the newly added items like it does in iE. It just occured to me that i dont really have to use a span, and a html <hr> tag could do...
2
2274
by: ed | last post by:
Hello- i'm having some problems getting innerhtml to clear on mozilla, but it works fine in ie. my page is setup such that i have a div: <div id="otherModel"></div> on a select from a combo box, in my javascript i execute: div = document.getElementById("otherModel"); depending on what's selected in a combobox, i execute:
8
7753
by: Clément | last post by:
Hi! I am currently developping a user interface with Ajax/C#/.net. And I am facing a problem with Mozilla, and Firefox. I use the function innerHTML to load a Web UserControl into a div, this way the main page never gets refreshed. It works perfectly under IE, but with Mozilla and Firefox I got a problem : there is a space before the...
8
2266
by: bennett.matthew | last post by:
Hello all, This is probably an elementary (no pun intended) question, but I've spent all afternoon on it and it's driving me crazy. I have a function which dynamically adds to a table. It receives a variable which basically encapsulates this: <div id="tableid"> <tr>
2
3090
by: Jonny B | last post by:
Hi all, I'm working on an a clientside xslt using jscript that passes a parameter to the xsl. I've got it working no problem in IE but cant get it to work in Mozilla. Can anyone help? This is my IE code - <html> <head> <title>CEL Learning</title>
0
7360
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7600
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7761
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5899
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5289
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4906
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3400
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1833
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
983
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.