473,511 Members | 15,178 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
insertAdjacentHTML).

Thanks

Jul 23 '05 #1
1 1315


jh*****@yahoo.com 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="javascript: functionName()">
or
<a href="#"
onclick="functionName();">
and the problem goes away with
<a href="#"
onclick="functionName(); 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.createElement && (div = document.createElement('div'))) {
span = document.createElement('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.appendChild(document.createTextNode('span 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
5007
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....
10
3561
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...
1
9010
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 =...
6
5016
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. ...
4
2520
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...
6
2818
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...
2
2272
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...
8
7750
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...
8
2258
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...
2
3088
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...
0
7237
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
7137
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...
1
7074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5659
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,...
1
5063
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...
0
4734
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...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1572
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 ...

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.