By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,509 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

Permission Denied error - javascript when accessing activex object

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a

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.