Jump to content

window.frameElement -> Access is Denied


BryanHood

Recommended Posts

The following code snippet is in one of my JavaScripts:

    function ResizeMe(idGrid, ExtraWidth, ExtraHeight)    {  if(window.frameElement != null)  {      if(window.frameElement.tagName == "IFRAME") 	 {

If I run the above code without any kind of Frames, it works fine. However, when the page loads inside a frame, I get an "Access is Denied" error whenever I try to reference the window.frameElement object.I am only developing this for IE, so I don't have to worry about Mozilla or Opera.Help!Thanks, Bryan

Link to comment
Share on other sites

Aaaarrrgggg! Is there a way around this?My code is just making sure that it's window is big enough to show a grid in it.Can I change the size of my "Current" window without trying to hit the parent frame set?

it may be denying access because javascript isn't allowed to access frames that are not of the same domain.

Link to comment
Share on other sites

here is some JS to check the size and resize if necessary

var scr_w = screen.availWidth;var scr_h = screen.availHeight;var browseWidth, browseHeight;if (document.all){   browseWidth=document.body.clientWidth;   browseHeight=document.body.clientHeight;}else{   browseWidth=window.outerWidth;   browseHeight=window.outerHeight;}if (scr_w != browseWidth|| scr_h != browseHeight) {   window.resizeTo(scr_w, scr_h);   window.moveTo(0, 0);}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...