469,346 Members | 6,518 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,346 developers. It's quick & easy.

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 1731
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

23 posts views Thread by Michel Bany | last post: by
3 posts views Thread by Q1tum | last post: by
5 posts views Thread by Moses | last post: by
2 posts views Thread by =?Utf-8?B?cm9kY2hhcg==?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.