Q

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'); 
 
... 
 
} 

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 last published in October 2002

Dig Deeper on XML and XML schema

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close