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(){
    var parser=new ActiveXObject("Microsoft.XMLDOM");
    var parser=document.implementation.createDocument("","",null);

return parser;
  1. var parser=this.getXmlParser();
  2. var list=parser.load("SiteList.xml");
  3. var url=list.getElementsByTagName("url"); //here is the error...
  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?

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

Post 3+ Months Ago

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8411
  • 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 97 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

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