473,395 Members | 1,738 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,395 software developers and data experts.

IE7 and myXML.getElementsByTagName('myTag').length

Hello!
I'm having a quiet big problem with ie7 [what a surprise.....].
I've made a search engine with AJAX implementations, and some XML....
It works fine under Firefox... but my Dear IE cry about an object
which doesn't support a method.

Here's a part of my code:

function showPrest(begin) {
debug = document.getElementById('debug');
tmp = myXML.getElementsByTagName('prestataire'); // HERE IS THE
CRYING POINT !
xmlLn = tmp.length;
end=10;
buttonN = '<span style="color:1b39a7;text-decoration:none;">suivant</
span>';
begin = parseInt(begin);
if(begin+10<xmlLn) {
if(begin != 0) end = begin + 10;
buttonN = '<span style="color:1b39a7;text-
decoration:underline;cursor:pointer;" onclick="showPrest(\''+end
+'\')">suivant</span>'; // bouton suivant

} else { // si la longeur de begin+10>xmlLn, on s'arrete a xmlLn
end = xmlLn;
}
buttonP = '<span style="color:1b39a7;text-
decoration:none;">pr&eacute;c&eacute;dent</span>';
if(begin !=0) {
buttonP = '<span style="color:1b39a7;text-
decoration:underline;cursor:pointer;"onclick="show Prest(\''+
(begin-10)+'\')">pr&eacute;c&eacute;dent</span>';
}

nb = Math.round(xmlLn/10);
list = '';
for(i=0;i<nb;i++) {
if(begin == 10*i)
list += '<span style="color:1b39a7;text-
decoration:none;cursor:pointer;">'+(i+1)+'</span';
else
list += '<span style="color:1b39a7;text-
decoration:underline;cursor:pointer;" onclick="showPrest(\''+
(i*10)+'\');">'+(i+1)+'</span';
}
<SNIP>
moyenne</td></tr>';
for(i=begin;i<end;i++) {
prest = myXML.getElementsByTagName('prestataire')[i];
out += '<tr>';
<SNIP>
}
out += '<tr><td colspan="5" style="text-align:right">'+buttonP+' |
'+list+'| '+buttonN+'</td></tr>';
out += '</table>';
document.getElementById('showResult').innerHTML = out;
if(expend) {
expendAll();
}
}
So, IE complains about my line tmp =
myXML.getElementsByTagName('prestataire'); , saying
"Line 16, char 3, this object doesn't manage this property or method,
code 0"
great... which object? which property/method?
My xml is correct and can be see here :
http://www.progonline.com/search_eng...rest&words=php
and search engine here :
http://www.progonline.com/visitor_my...uoi=rechercher

If anyone has a solution....

Thanks in advance!

regards

Tengu

Mar 2 '07 #1
1 1809
I've found a hint:
"myXML" is declared as a global var outside my functions.... it's
empty at the begining, then a function fill it with datas.... and call
the one I show up earlier.....
->IE doesn't support it, as I can see.... great, have to recode all
for this.... this.... well, there are no words to define it :/

if someone has another answer/solution [other than "do not use
IE"..... ^^' ]

regards

Tengu

Mar 2 '07 #2

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

Similar topics

23
by: Michel Bany | last post by:
I am trying to parse responseXML from an HTTP request. var doc = request.responseXML; var elements = doc.getElementsByTagName("*"); the last statement returns an empty collection when running from...
3
by: Q1tum | last post by:
Hi all, I have a problem with getting the amount of childs in a XML structure, the strucure is somewhat like the following: <?xml version="1.0" encoding="iso-8859-1"?> <cms> <num>21</num>...
2
by: JJA | last post by:
Here is my entire XML file - simplified to one node for testing: <root> <FlasConustbl> <ID>42101</ID> <AWARD>P015B030001</AWARD> <INSTITUTION_KEY>300</INSTITUTION_KEY> <INSTITUTION>Boston...
5
by: Moses | last post by:
HI The Value for childNodes.length differs with mozilla and IE Is it problem with my coding..... I could not under stood............. The following is the details
1
by: Ben | last post by:
I have a web service that returns the following xml: <?xml version="1.0" encoding="utf-8" ?> <NewDataSet> <Addresses> <XML_F52E2B61-18A1-11d1-B105-00805F49916B> <CustomerAddressBase...
5
by: eBob.com | last post by:
I am so frustrated. I've been working all weekend on what I thought would be a simple script. I never find it easy to look at someone else's code, but if someone can help with this I would be...
2
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, is there a way to delete or remove and item from the results of getElementsByTagName? thanks, rodchar
15
Dormilich
by: Dormilich | last post by:
I’m trying to do the following document.getElementsByTagName("sup").getElementsByTagName("a"); currently I have this because I somehow need to return a combined result NodeList // can’t prototype...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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
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
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,...

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.