getElementsByTagName is not a function? (js)

  • danmerrino
  • Novice
  • Novice
  • danmerrino
  • Posts: 21

Post 3+ Months Ago

Hello there,

I have never tried to process any XML with javascript before. And now i get the error "getElementsByTagName is not a function" when i am simply trying to get an array with all the nodes of that name:

Code: [ Select ]
var parser=this.getXmlParser();
var list=parser.load("SiteList.xml");
var url=list.getElementsByTagName("url"); //here is the error...
    

function getXmlParser(){
if(window.ActiveXObject){
    var parser=new ActiveXObject("Microsoft.XMLDOM");
}else{
    var parser=document.implementation.createDocument("","",null);
}

parser.async="false";
return parser;
}
  1. var parser=this.getXmlParser();
  2. var list=parser.load("SiteList.xml");
  3. var url=list.getElementsByTagName("url"); //here is the error...
  4.     
  5. function getXmlParser(){
  6. if(window.ActiveXObject){
  7.     var parser=new ActiveXObject("Microsoft.XMLDOM");
  8. }else{
  9.     var parser=document.implementation.createDocument("","",null);
  10. }
  11. parser.async="false";
  12. return parser;
  13. }


Are there any smart nerds here who can help me understand why this is the case?

greetings,
dan
Moderator Remark: Added [code] tags
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

See if this helps you any.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 105 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.