Connecting Tech Pros Worldwide Forums | Help | Site Map

ActiveXObject

Peter Kirk
Guest
 
Posts: n/a
#1: Jul 23 '05
Hi there,

I am having trouble with ActiveXObject. I have a function which includes
this snippet:

alert('INIT 1');
orgdoc = new ActiveXObject('Microsoft.XMLDOM');
alert('INIT 2');

I see the "INIT 1" alert box, but "INIT 2" is never displayed. It is as if
the ActiveXObject fails and the function exits without executing anything
else. Is that possible? And what could possible problems be?

Thanks,
Peter


Randy Webb
Guest
 
Posts: n/a
#2: Jul 23 '05

re: ActiveXObject


Peter Kirk wrote:
[color=blue]
> Hi there,
>
> I am having trouble with ActiveXObject. I have a function which includes
> this snippet:
>
> alert('INIT 1');
> orgdoc = new ActiveXObject('Microsoft.XMLDOM');
> alert('INIT 2');
>
> I see the "INIT 1" alert box, but "INIT 2" is never displayed. It is as if
> the ActiveXObject fails and the function exits without executing anything
> else. Is that possible? And what could possible problems be?
>[/color]

With IE6, and this script I get both alerts:

function testIt(){
alert('INIT 1');
orgdoc = new ActiveXObject('Microsoft.XMLDOM');
alert('INIT 2');
}
window.onload = testIt;

What browser are you testing it in?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Grant Wagner
Guest
 
Posts: n/a
#3: Jul 23 '05

re: ActiveXObject


Peter Kirk wrote:
[color=blue]
> Hi there,
>
> I am having trouble with ActiveXObject. I have a function which includes
> this snippet:
>
> alert('INIT 1');
> orgdoc = new ActiveXObject('Microsoft.XMLDOM');
> alert('INIT 2');
>
> I see the "INIT 1" alert box, but "INIT 2" is never displayed. It is as if
> the ActiveXObject fails and the function exits without executing anything
> else. Is that possible? And what could possible problems be?
>
> Thanks,
> Peter[/color]

Look in the lower left corner of Internet Explorer for a yellow !. If it is
there, double-click it, you'll most likely see that your code is causing an
error. Security settings might be preventing ActiveX objects from being run,
in which case, your code would be generating an "Automation server can't
create object" error.


--
| Grant Wagner <gwagner@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html


Closed Thread