"Access is denied" Error 
Author Message
 "Access is denied" Error

Hi,
I'm getting "Access is denied" whenever I click on a link that redirect the
href to JS function .it apperars only from the 2nd click on the link, no
matter which 1.

JS function:
---------------
function setURL(myUrl)
{
 var picSize = getPictureSize();
 parent.frames[2].document.location= myUrl+"&pictureSize="+picSize+"";

Quote:
}

body:
-------
<a class=Camera
href="javascript:setURL('http:\\\\192.168.250.137:8080\\login.jsp')">camera1
</a>


Sun, 31 Aug 2003 17:10:33 GMT  
 "Access is denied" Error
This is a problem with JScript security. This matter is described in MSDN.

For example you have two frames. First one is loaded from server A, second
one is loaded from server B. JScript functions from first frame have not
access to objects, variables and functions from second frame because of
security.

In your example first time you load a document from your server. After you
click on link your frame (which shows a picture) is loaded from another
server. After this you have no access to parent.frames[2].document object of
the frame.

Solution:
You have a name of the frame (which shows a picture). Use <a href="url ..."
target="NAME_OF_THE_FRAME">...</a>


Quote:
> Hi,
> I'm getting "Access is denied" whenever I click on a link that redirect
the
> href to JS function .it apperars only from the 2nd click on the link, no
> matter which 1.

> JS function:
> ---------------
> function setURL(myUrl)
> {
>  var picSize = getPictureSize();
>  parent.frames[2].document.location= myUrl+"&pictureSize="+picSize+"";
> }

> body:
> -------
> <a class=Camera

href="javascript:setURL('http:\\\\192.168.250.137:8080\\login.jsp')">camera1

- Show quoted text -

Quote:
> </a>



Sun, 31 Aug 2003 18:56:10 GMT  
 "Access is denied" Error

Quote:
> Hi,
> I'm getting "Access is denied" whenever I click on a link that redirect
the
> href to JS function .it apperars only from the 2nd click on the link, no
> matter which 1.

> JS function:
> ---------------
> function setURL(myUrl)
> {
>  var picSize = getPictureSize();
>  parent.frames[2].document.location= myUrl+"&pictureSize="+picSize+"";
> }

> body:
> -------
> <a class=Camera

href="javascript:setURL('http:\\\\192.168.250.137:8080\\login.jsp')">camera1

Quote:
> </a>

This topic is explained very well at

http://msdn.microsoft.com/workshop/author/om/xframe_scripting_securit...

You have no access to documents from another domain. This includes the
document object from the second frame.

However, you do have permission to change the location of the frame, which
you can do without using the document object:

parent.frames[2].location.href = myUrl + '"&pictureSize=" + picSize;

--
Thor Larholm



Sun, 31 Aug 2003 22:23:07 GMT  
 "Access is denied" Error
The thing is that frame object has not "location" property. Frame has "scr"
property only.


Quote:


> > Hi,
> > I'm getting "Access is denied" whenever I click on a link that redirect
> the
> > href to JS function .it apperars only from the 2nd click on the link, no
> > matter which 1.

> > JS function:
> > ---------------
> > function setURL(myUrl)
> > {
> >  var picSize = getPictureSize();
> >  parent.frames[2].document.location= myUrl+"&pictureSize="+picSize+"";
> > }

> > body:
> > -------
> > <a class=Camera

href="javascript:setURL('http:\\\\192.168.250.137:8080\\login.jsp')">camera1

- Show quoted text -

Quote:
> > </a>

> This topic is explained very well at

> http://msdn.microsoft.com/workshop/author/om/xframe_scripting_securit...

> You have no access to documents from another domain. This includes the
> document object from the second frame.

> However, you do have permission to change the location of the frame, which
> you can do without using the document object:

> parent.frames[2].location.href = myUrl + '"&pictureSize=" + picSize;

> --
> Thor Larholm



Sun, 31 Aug 2003 22:44:22 GMT  
 "Access is denied" Error

Quote:
> The thing is that frame object has not "location" property. Frame has
"scr"
> property only.

If you had tried my code, you would see that it worked.

The thing is that the frame object you are referencing in reality is a
window object. Every window object has a location object, which is what we
use.

--
Thor Larholm

Quote:




> > > Hi,
> > > I'm getting "Access is denied" whenever I click on a link that
redirect
> > the
> > > href to JS function .it apperars only from the 2nd click on the link,
no
> > > matter which 1.

> > > JS function:
> > > ---------------
> > > function setURL(myUrl)
> > > {
> > >  var picSize = getPictureSize();
> > >  parent.frames[2].document.location= myUrl+"&pictureSize="+picSize+"";
> > > }

> > > body:
> > > -------
> > > <a class=Camera

href="javascript:setURL('http:\\\\192.168.250.137:8080\\login.jsp')">camera1
Quote:
> > > </a>

> > This topic is explained very well at

http://msdn.microsoft.com/workshop/author/om/xframe_scripting_securit...

- Show quoted text -

Quote:

> > You have no access to documents from another domain. This includes the
> > document object from the second frame.

> > However, you do have permission to change the location of the frame,
which
> > you can do without using the document object:

> > parent.frames[2].location.href = myUrl + '"&pictureSize=" + picSize;

> > --
> > Thor Larholm



Sun, 31 Aug 2003 23:21:10 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. "Access is denied" error

2. "Access is denied" error

3. "Access denied" when accessing script object

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

5. "Access denied" on document.LastModified Object

6. "Access denied" - urgent

7. "access denied" on cross domain scripting

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

9. "Access is denied" with frames

10. "access denied"

11. "Access is denied" with frames

12. "access denied"

 

 
Powered by phpBB® Forum Software