473,703 Members | 4,277 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 1323


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
5021
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
3597
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
9094
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
5042
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
2542
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 able to reproduce it in very simple form (which is itself a puzzle). But example code is...
6
2833
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 the trick -I will go try. But aside from that could some one explain why this occurs? And will I get...
2
2287
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
7772
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 thing I want to display everytime I use ".innerHTML".
8
2291
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
3098
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
8761
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8674
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9262
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9018
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7876
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6595
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4434
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2463
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2070
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.