Permission Denied error - javascript when accessing activex object

  • Thread starter nandakumar.raghu
  • Start date
N

nandakumar.raghu

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><td> Alert3 !</td></tr>");
}
else if((value = alertObject.Alert3Prop) == false)
{
document.writeln("<tr><td>Alert3 Normal</td></tr>");
}

if((value = alertObject.Alert4Prop) == true)
{
document.writeln("<tr><td> Alert4 !</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
 
M

marss

(e-mail address removed) напиÑав:
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><td> Alert3 !</td></tr>");
}
else if((value = alertObject.Alert3Prop) == false)
{
document.writeln("<tr><td>Alert3 Normal</td></tr>");
}

if((value = alertObject.Alert4Prop) == true)
{
document.writeln("<tr><td> Alert4 !</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();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,734
Latest member
manin

Latest Threads

Top