469,950 Members | 1,743 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

Permission Denied error - javascript when accessing activex object

Hi,

I have written a javascript function that acceses properties from an
activex object. -

<OBJECT id="alertObj"
classid="clsid:AEE77194-B98F-4E0E-A27F-4AD6B23F0038"></OBJECT>
function onLoadfunc()
{

//document.writeln("<table>");
var alertObject = document.alertObj;

var value;
if((value = alertObject.Alert1Prop) == true )
{
document.writeln("<tr><td>Alert1!</td></tr>");
}
else if((value = alertObject.Alert1Prop) == false )
{

document.writeln("<tr><td>Alert1 Normal</td></tr>");
}

if((value = alertObject.Alert2Prop) == true)
{
document.writeln("<tr><td>Alert2!</td></tr>");
}
else if((value = alertObject.Alert2Prop) == false)
{
document.writeln("<tr><td>Alert2 Normal</td></tr>");
}
if((value = alertObject.Alert3Prop) == true)
{
document.writeln("<tr><tdAlert3 !</td></tr>");
}
else if((value = alertObject.Alert3Prop) == false)
{
document.writeln("<tr><td>Alert3 Normal</td></tr>");
}

if((value = alertObject.Alert4Prop) == true)
{
document.writeln("<tr><tdAlert4 !</td></tr>");
}
else if((value = alertObject.Alert4Prop) == false)
{
document.writeln("<tr><td>Alert4 Normal</td></tr>");
}
}

I am able to access the first property properly, but for the next if()
i get "permission denied" error.
i changed the positions of the if's , and still i am able to access
only one property then i get the "permission denied" error.

My activex vb6 object implements the IObjectSafety interface also.

Any ideas?

Thanks
NK

Nov 1 '06 #1
1 6699

na**************@gmail.com написав:
Hi,

I have written a javascript function that acceses properties from an
activex object. -

<OBJECT id="alertObj"
classid="clsid:AEE77194-B98F-4E0E-A27F-4AD6B23F0038"></OBJECT>
function onLoadfunc()
{

//document.writeln("<table>");
var alertObject = document.alertObj;

var value;
if((value = alertObject.Alert1Prop) == true )
{
document.writeln("<tr><td>Alert1!</td></tr>");
}
else if((value = alertObject.Alert1Prop) == false )
{

document.writeln("<tr><td>Alert1 Normal</td></tr>");
}

if((value = alertObject.Alert2Prop) == true)
{
document.writeln("<tr><td>Alert2!</td></tr>");
}
else if((value = alertObject.Alert2Prop) == false)
{
document.writeln("<tr><td>Alert2 Normal</td></tr>");
}
if((value = alertObject.Alert3Prop) == true)
{
document.writeln("<tr><tdAlert3 !</td></tr>");
}
else if((value = alertObject.Alert3Prop) == false)
{
document.writeln("<tr><td>Alert3 Normal</td></tr>");
}

if((value = alertObject.Alert4Prop) == true)
{
document.writeln("<tr><tdAlert4 !</td></tr>");
}
else if((value = alertObject.Alert4Prop) == false)
{
document.writeln("<tr><td>Alert4 Normal</td></tr>");
}
}

I am able to access the first property properly, but for the next if()
i get "permission denied" error.
i changed the positions of the if's , and still i am able to access
only one property then i get the "permission denied" error.

My activex vb6 object implements the IObjectSafety interface also.

Any ideas?

Thanks
NK
Try to close document after each change:
Ex.:
document.writeln("...");
document.close();

Nov 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.