Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 1st, 2007, 11:05 PM
Tengu
Guest
 
Posts: n/a
Default 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


  #2  
Old March 1st, 2007, 11:45 PM
Tengu
Guest
 
Posts: n/a
Default Re: IE7 and myXML.getElementsByTagName('myTag').length

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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.