Could you provide us with the details from the script debugger window?
Anyway, I think there are two possibilities for this problem:
- The ActiveXObject couldn't be created.
I had this before, for some reason my Windows installation couldn't recognize Microsoft.XMLDOM any more. After some research, I found that MSXML2.DOMDocument still worked, but then again that didn't work on other computers. I decided to implement both of them in a try...catch block so that it would always find a working ActiveXObject.
So, instead of using new ActiveXObject('MSXML.DOMDocument');, I now call CreateXML() after defining it as followed:
js code:
//Creates a new XMLDOM instance
function CreateXML() {
try {
var xml = new ActiveXObject("Microsoft.XMLDOM");
} catch(e) { try {
var xml = new ActiveXObject("MSXML2.DOMDocument");
} catch(e) { return; } }
xml.async = false;
return xml;
}
- The path may be faulty.
I see that you're using a slash in your path, try a backslash instead. Of course, in JScript you have to escape a backslash with a backslash, so that line should look something like this:
js code:
XML.load(MsgPlus.ScriptFilesPath + '\\tasks.xml');
- The file might still be loading when you try to access it.
This can be easily fixed by setting async to false, forcing the XML DOM object to load the XML file synchronously. As you can see above, my function does this automatically since I don't use asynchronous XML loading very often in my scripts.
It would help if you posted the full error message though.
Hint: these forums can do syntax highlighting by wrapping your code in [code=js] ... [/code] tags (for JScript, that is), it makes your code easier to read for others.