"Access denied" when accessing script object 
Author Message
 "Access denied" when accessing script object

I have an odd problem that I have not been able to solve.  Hopefully,
somebody here will be able to help....

I have a javascript function called loadFrame():

function loadFrame(stylesheet)
{
   var docStyleSheet = new ActiveXObject("Microsoft.XMLDOM");
   docStyleSheet.async = false;
   docStyleSheet.load(stylesheet);

   window.document.XMLDocument = window.parent.window.document.XMLDocument;
   while (window.document.XMLDocument.readyState != 4);
   window.document.XSLDocument = docStyleSheet;
   window.document.write(window.document.XMLDocument.transformNode
(docStyleSheet));

Quote:
}

It loads a frame with XML given a stylesheet.  It gets invoked with a simple
stub HTML file that contains only script code to populate the frame:

<SCRIPT LANGUAGE="JSCRIPT" SRC="ArrayXad.js"></SCRIPT>
<SCRIPT LANGUAGE="JAVASCRIPT">
        loadFrame('Main.xsl');
</SCRIPT>

This works fine locally.  But when I try to move the files to our web
server and access them from there, I run into problems in the script.
The script file itself can be accessed, but when the script is run I
get an error message "Line:32 Error: Permission denied".  The line in
question is:

   window.document.XMLDocument = window.parent.window.document.XMLDocument;

Why is this happening?  It doesn't seem to be a file access problem, as
the script is being run when the error occurs (so I can obviously get
to the file OK).

As part of the debugging, I tried changing all the references from
"http://filename..." to local references (i.e. "file://C:/filename").
That loads up fine as well.  It's only when I try to reference them off
the web server that I get this problem.

Ideas?  Can anybody help?

Thanks in advance,

-- Greg



Sun, 07 Dec 2003 02:33:39 GMT  
 "Access denied" when accessing script object
The page or frameset the code is on must originate from a page served by the
same virtual server (ie same server, same base url - http://www.*-*-*.com/ and
http://localhost are two different sources, for instance) as the page in the
frame the code is trying to access.  All three of these:

- window.document
- window.parent
- window.parent.window.document.XMLDocument;

must be from the same place.

Either they are not, or there perhaps could be some odd behaviour by which a
hitherto unreferenced XMLDocument has by default taken on a file://
identity, disallowing you to access it unless your document also has a
file:// identity.

Have you used the Visual Interdev de{*filter*} to follow the execution of the
script and inspect the objects in question?  That would be the most
informative tool, I expect.

 - Brent -


I have an odd problem that I have not been able to solve.  Hopefully,
somebody here will be able to help....

I have a javascript function called loadFrame():

function loadFrame(stylesheet)
{
   var docStyleSheet = new ActiveXObject("Microsoft.XMLDOM");
   docStyleSheet.async = false;
   docStyleSheet.load(stylesheet);

   window.document.XMLDocument = window.parent.window.document.XMLDocument;
   while (window.document.XMLDocument.readyState != 4);
   window.document.XSLDocument = docStyleSheet;
   window.document.write(window.document.XMLDocument.transformNode
(docStyleSheet));

Quote:
}

It loads a frame with XML given a stylesheet.  It gets invoked with a simple
stub HTML file that contains only script code to populate the frame:

<SCRIPT LANGUAGE="JSCRIPT" SRC="ArrayXad.js"></SCRIPT>
<SCRIPT LANGUAGE="JAVASCRIPT">
loadFrame('Main.xsl');
</SCRIPT>

This works fine locally.  But when I try to move the files to our web
server and access them from there, I run into problems in the script.
The script file itself can be accessed, but when the script is run I
get an error message "Line:32 Error: Permission denied".  The line in
question is:

   window.document.XMLDocument = window.parent.window.document.XMLDocument;

Why is this happening?  It doesn't seem to be a file access problem, as
the script is being run when the error occurs (so I can obviously get
to the file OK).

As part of the debugging, I tried changing all the references from
"http://filename..." to local references (i.e. "file://C:/filename").
That loads up fine as well.  It's only when I try to reference them off
the web server that I get this problem.

Ideas?  Can anybody help?

Thanks in advance,

-- Greg



Sun, 07 Dec 2003 03:10:06 GMT  
 "Access denied" when accessing script object
Well, that's probably the problem.  Here is what I am trying to
do....

I have an XML document locally.  I want to use stylesheets
on the web server to display the document in my browser.  The top
line of the XML document points to the stylesheet that will format
the XML document for display:

<?xml version ="1.0"?>
<!DOCTYPE Journal SYSTEM "http://server/datadefn.dtd">
<?xml-stylesheet type="text/xsl" href="http://server/stylesheet.xsl"?>

Now this XML file probably has a "file" reference, right?  

Assuming that to be true, is there a way around this?  What I am
trying to do is to take the XML document and display it in two
different frames in the browser -- where the document may be local
and the stylesheets/DTD reside on the web server.

Thanks again,

-- Greg

Quote:
-----Original Message-----

The page or frameset the code is on must originate from a page served by the
same virtual server (ie same server, same base url - http://www.*-*-*.com/ and
http://localhost are two different sources, for instance) as the page in the
frame the code is trying to access.  All three of these:

- window.document
- window.parent
- window.parent.window.document.XMLDocument;

must be from the same place.

Either they are not, or there perhaps could be some odd behaviour by which a
hitherto unreferenced XMLDocument has by default taken on a file://
identity, disallowing you to access it unless your document also has a
file:// identity.

Have you used the Visual Interdev de{*filter*} to follow the execution of the
script and inspect the objects in question?  That would be the most
informative tool, I expect.

 - Brent -



I have an odd problem that I have not been able to solve.  Hopefully,
somebody here will be able to help....

I have a javascript function called loadFrame():

function loadFrame(stylesheet)
{
   var docStyleSheet = new ActiveXObject("Microsoft.XMLDOM");
   docStyleSheet.async = false;
   docStyleSheet.load(stylesheet);

   window.document.XMLDocument = window.parent.window.document.XMLDocument;
   while (window.document.XMLDocument.readyState != 4);
   window.document.XSLDocument = docStyleSheet;
   window.document.write(window.document.XMLDocument.transformNode
(docStyleSheet));
}

It loads a frame with XML given a stylesheet.  It gets invoked with a simple
stub HTML file that contains only script code to populate the frame:

<SCRIPT LANGUAGE="JSCRIPT" SRC="ArrayXad.js"></SCRIPT>
<SCRIPT LANGUAGE="JAVASCRIPT">
loadFrame('Main.xsl');
</SCRIPT>

This works fine locally.  But when I try to move the files to our web
server and access them from there, I run into problems in the script.
The script file itself can be accessed, but when the script is run I
get an error message "Line:32 Error: Permission denied".  The line in
question is:

   window.document.XMLDocument = window.parent.window.document.XMLDocument;

Why is this happening?  It doesn't seem to be a file access problem, as
the script is being run when the error occurs (so I can obviously get
to the file OK).

As part of the debugging, I tried changing all the references from
"http://filename..." to local references (i.e. "file://C:/filename").
That loads up fine as well.  It's only when I try to reference them off
the web server that I get this problem.

Ideas?  Can anybody help?

Thanks in advance,

-- Greg

.



Sun, 07 Dec 2003 04:52:46 GMT  
 "Access denied" when accessing script object
Well, this is the problem.  But it doesn't answer
the question of how to do what I want....

I am storing all my stylesheets and HTML on the
web server.  On the client/local machine, I have
an XML document.  Inside the XML document, there
is a stylesheet tag that points to the stylesheet
residing on the web server.  

That first stylesheet dynamically generates two
frames (again, with HTML on the web server), each
of which is to display a different view of the
XML document (again, using two different stylesheets
on the web server).

It doesn't seem like I am trying to do anything
out of the ordinary here:

1. XML document local.
2. All stylesheets, etc. stored on the web server.

Is there some way to make this work?

Thanks again,

-- Greg

Quote:
>-----Original Message-----
>The page or frameset the code is on must originate from a
page served by the
>same virtual server (ie same server, same base url -

http://www.*-*-*.com/ and
Quote:
>http://localhost are two different sources, for instance)
as the page in the
>frame the code is trying to access.  All three of these:

>- window.document
>- window.parent
>- window.parent.window.document.XMLDocument;

>must be from the same place.

>Either they are not, or there perhaps could be some odd

behaviour by which a
Quote:
>hitherto unreferenced XMLDocument has by default taken on
a file://
>identity, disallowing you to access it unless your
document also has a
>file:// identity.

>Have you used the Visual Interdev de{*filter*} to follow the
execution of the
>script and inspect the objects in question?  That would
be the most
>informative tool, I expect.

> - Brent -



>I have an odd problem that I have not been able to
solve.  Hopefully,
>somebody here will be able to help....

>I have a javascript function called loadFrame():

>function loadFrame(stylesheet)
>{
>   var docStyleSheet = new ActiveXObject

("Microsoft.XMLDOM");
Quote:
>   docStyleSheet.async = false;
>   docStyleSheet.load(stylesheet);

>   window.document.XMLDocument =

window.parent.window.document.XMLDocument;
Quote:
>   while (window.document.XMLDocument.readyState != 4);
>   window.document.XSLDocument = docStyleSheet;
>   window.document.write

(window.document.XMLDocument.transformNode
Quote:
>(docStyleSheet));
>}

>It loads a frame with XML given a stylesheet.  It gets

invoked with a simple

- Show quoted text -

Quote:
>stub HTML file that contains only script code to populate
the frame:

><SCRIPT LANGUAGE="JSCRIPT" SRC="ArrayXad.js"></SCRIPT>
><SCRIPT LANGUAGE="JAVASCRIPT">
>loadFrame('Main.xsl');
></SCRIPT>

>This works fine locally.  But when I try to move the
files to our web
>server and access them from there, I run into problems in
the script.
>The script file itself can be accessed, but when the
script is run I
>get an error message "Line:32 Error: Permission denied".  
The line in
>question is:

>   window.document.XMLDocument =

window.parent.window.document.XMLDocument;
Quote:

>Why is this happening?  It doesn't seem to be a file
access problem, as
>the script is being run when the error occurs (so I can
obviously get
>to the file OK).

>As part of the debugging, I tried changing all the
references from
>"http://filename..." to local references

(i.e. "file://C:/filename").

- Show quoted text -

Quote:
>That loads up fine as well.  It's only when I try to
reference them off
>the web server that I get this problem.

>Ideas?  Can anybody help?

>Thanks in advance,

>-- Greg

>.



Sun, 07 Dec 2003 09:18:57 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. "Access denied" on document.LastModified Object

2. "access denied" on cross domain scripting

3. "Access is denied" Error

4. "Access is denied" error

5. "Access denied" - urgent

6. ASP ADSI "GENERAL ACCESS DENIED"???

7. "Access is denied" with frames

8. "access denied"

9. "Access is denied" error

10. "Access is denied" with frames

11. "access denied"

12. "Access denied" error when accessing "location.search" with IE6

 

 
Powered by phpBB® Forum Software