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 first published in October 2002
This Content Component encountered an error

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close