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

T

Tengu

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="showPrest(\''+
(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');
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_engine/treate.php?cat=prest&words=php
and search engine here :
http://www.progonline.com/visitor_mypage.php?quoi=rechercher

If anyone has a solution....

Thanks in advance!

regards

Tengu
 
T

Tengu

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top