Posted on 2006-05-21
I have the following script inside a js file:
var myXobj = new ActiveXObject("PodObject.PodService");
AddXtoPC(arg1,title,ID); // Open popup to add channel to PC
// Service is not present, ask for installation
showInstallX(arg1,title,ID); // Open popup to ask for download of PodObject
It works perfect when I call it directly from my HTML page. But when I call it from a <div> layer that is dynamically generated and appended to the same page with an onClick event, I get a really strange behavior.
The first time I click on the button to call the js file, I get the following error message (coming from the activeX control): "Object expected", the error message is 5007. This happens even if the PodObject.PodService is present. So the wrong function gets called:showInstallX() .
The weird thing is that the second time I click on the button, it works !?!?!?! ... I do not get an error message, and the right function gets called ( AddXtoPC() ).
Does anybody have a clue what can be happening?
Does anybody know what error message 5007 mean? I try searching the internet for a comprehensive error message guide to activeX error messages, but could no t find anything.