Got this code, which works fine in FF3 - it dynamically redraws a menu
from user input.
####
function so_clearInnerHTML(obj) {
// so long as obj has children, remove them
while(obj.firstChild) obj.removeChild(obj.firstChild);
} - this just for info - ignore that there is no function around the next
bit!
if (httpRequest.status == 200) {
var xmldoc = httpRequest.responseXML;
//var objNodeList;
//objNodeList = xmldoc.getElementsByTagName
( isystemname);
so_clearInnerHTML(document.getElementById
("systemslist"));
// loop through the returned xml list for entries and
append them back to the div
var x = 0;
while (xmldoc.getElementsByTagName( isystemname)[x]) {
//alert(counted[+i+]);
var sysname = xmldoc.getElementsByTagName
( isystemname)[x].childNodes[0].nodeValue;
var sysid = xmldoc.getElementsByTagName( isystemid)
[x].childNodes[0].nodeValue;
//alert( isystemname[+sysname+]);
//alert( isystemid[+sysid+]);
// create a DIV element, using the variable eLink as
a reference to it
eLink = document.createElement("a");
//use the setAttribute method to assign it an id
eLink.setAttribute("href","findsystem.asp?
systemid="+sysid);
// add the text from isystemname to the anchor
element
eLink.appendChild(document.createTextNode
(xmldoc.getElementsByTagName( isystemname)[x].childNodes[0].nodeValue));
// append your newly created element to an already
existing element.
document.getElementById("systemslist").appendChild
(eLink);
eBreak = document.createElement("br");
document.getElementById("systemslist").appendChild
(eBreak);
x++;
}
} else {
alert(There was a problem with the request.);
}
####
doesn repopulate the menu via IE6 or 7
I tried to switch the while to a for -
##
for (var i=0; i<objNodeList.length; i++) {
##
(ignore the x switch in i)
but that returns a zero length list of nodes for IE, and still works for
FF
is there another way for IE to see the existance of the node list, or do
I need to approach the looping some other way?
source: newsgroups.derkeiler
Related Stuff
-
MooV: Using cutting edge Video phones and Software Video Phones - coupling all that with VoIP and empowering the disabled.
-
Moo Telecom: VoIP communications made easy - Ring anyway with the fun and ease of using a normal phone
-
TagR:Mobile Social Network with Real Time Locations Based services, and Ambience Intelligence, VoiP, IM, Skype, Googletalk, Mapping, Flickr, Events, Calendaring, Scheduling, SecondLife Support
-
ClearSMS : ClearSMS is a Web-based application that lets you send bulk SMS messages to your customers, contacts, or just about anyone.
-
Jajah:jah is a VoIP (Voice over IP) provider, founded by Austrians Roman Scharf and Daniel Mattes in 2005[1]. The Jajah headquarters are located in Mountain View, CA, USA, and Luxembourg. Jajah maintains a development centre in Israel.
-
Skype: It’s free to download and free to call other people on Skype. Skype the number one voice over ip software
- PrivatePhone: a free local phone number with voicemail and messages you can check online or from any phone.
Be the first ... |Add your comment.
Your Comment ...
Name (required)
Email (required, hidden)
Website
