Nico van Niekerk

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromNico van Niekerk
ToMe
SubjectPermission denied error on IFRAME data transfer
Date23 February 2005 00:40
Mark 'Tarquin',

My <iframe id='msgframe_1'> src is set to an .asp page on a remote IIS
server, which collects data and displays it in the iframe. It works fine.
However, if I want to move the data from the iframe to <input type='hidden'
id='jobs' value=''> on the present document I get an 'Permission Denied'
error. I tried pushing the data from the remote IIS server with

parent.document.getElementById('jobs').value='<%=jobrecs%>'

and pulling it from the present document from the iframe with

document.frames['msgframe_1'].window.document.getElementById('tiet') (which
is <div id='tiet'>var cnt='<%=jobrecs%>'</div>)

but both give 'Permission denied' errors.

If I use this method on the same IIS server, there is no problem.

Any ideas?

BTW, great site.

Thanks

Nico van Niekerk
FromMe
ToNico van Niekerk
SubjectRe: Permission denied error on IFRAME data transfer
Date23 February 2005 8:49
Nico,

Pages from one domain are not allowed to access pages from another domain.
That is a security violation. The parent page is not allowed to access
content in the ifarame, and the page in the iframe is not allowed to access
(or pass information to) the parent page.

The only way to do this is to use pages from the same web server. Since you
need to access files from another server, write an ASP script that gets the
file and serves it as if it came from its own domain;
in parent.asp:
<iframe src="getpage.asp?page=http://someOtherSite.com/otherPage.asp">;

the getpage.asp should then check if that is permitted (if the domain is
acceptable) then load the remote page, and pass the contents through as if
they were its own.


This should solve the problem

Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.