My JS fails after line 1. What am I doing wrong?

I am using Mozilla and I am writing a js (see below) and I am trying to load an XML file using DOM. However, the js fails after Line 1. It shows alert C1 on screen, never shows alert C2. What am I doing wrong?

 
function search() { 
 
   alert("C1"); 
 
   var oMystuff = new ActiveXObject("Microsoft.XMLDOM") 
// Line 1 
 
   alert("C2"); // Line 2 
 
   oMyStuff.load ('posters.xml'); 
 
... 
 
} 

    Requires Free Membership to View

Missing semi-colon on the line that creates an ActiveXObject. Failing that, something causing the browser to fail to create an XMLDOM sucessfully. You need to turn on javascript debugging and take a closer look at the error produced.

This was first published in October 2002

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.