Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to resize and IFRAME without getting an "Access Denied" error?

Status
Not open for further replies.

moham

Programmer
Nov 12, 2001
13
0
0
US
I am trying to resize an IFRAME embedded in a html page. The problem is the html page is in one domain and the IFRAME is a separate domain. I know there is the cross domain security that IE5.0 and above implements to restrict cross domain scripting, but it is not like I am trying to read or write I just want to resize, why doesn't IE let me do that?

Heres the code: (works fine for same domains)
document.getElementById(document.frames[0].name).style.height = '140%';
 
I guess you cant resize a page from an external domain as a p art of ther security settings. I dont know why though. A workaround which is VERY clumsy but will probably be work is (It may well be somebody else will have a much better solution!!) to redirect the iframe to view an internal page on your site which can be resized to the desired settings before being redirected back to the external source page at the new dimensions. You could automate the redirecting and resizing process so it can occur without user intervention using asp or javascript.

good luck

rob
 
I ended up embedding the IFRAME in a div tag and then resized the layer. Works great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top