Problem solve Get help with specific problems with your technologies, process and projects.

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() { 
   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.

Dig Deeper on Topics Archive

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.

Please create a username to comment.