467,926 Members | 1,460 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,926 developers. It's quick & easy.

Iframe ReturnValue returns undefined if domains are not the same

Iframe ReturnValue returns undefined if domains are not the same

I am using a modal window and an iFrame to try and pull a return value
back.
IMPORTANT : I am doing this across domains.
Main app: http://webSite1.domain.com/mainApplication
Other app call in ModalWindow:
http://webSite2.domain.com/mainApplication

I have the value returned from the modal window to the iFrame window
but I can not get the value returned to the parent window. The alert
in the parent window always returns undefined errors. Any help would
be much appreciated.
I call the modal window and wait for the return as such:
function LCC()
{
var aUrl = "http://.../IFrame.html";

sFeatures="dialogHeight:600px;*dialogWidth:850px;r esizable:ye*s;center:yes"

LCV = window.showModalDialog(aUrl,""*,sFeatures);
alert(LCV);

}
</script>

Here is the iFrame:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<script>
function onunloadevent(){
parent.window.returnValue =
window.frames[0].aValue.innerT*ext;
alert(window.returnValue);
}
</script>
<body onunload='onunloadevent();'>
<TABLE align='left' border='0'>
<TR>
<TD
align='center'><IFRAME frameborder='0'id="Frame1"
src="http://...../default.asp" Style="HEIGHT: 10in; WIDTH: 10in;
MARGIN=0" SCROLLING="no" ></IFRAME></TD>
</TR>
</table>
</body>
</html>

Jul 29 '05 #1
  • viewed: 6525
Share:
1 Reply

"Silver Arrow" <Si**********@voila.fr> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Iframe ReturnValue returns undefined if domains are not the same

I am using a modal window and an iFrame to try and pull a return value
back.
IMPORTANT : I am doing this across domains.
Main app: http://webSite1.domain.com/mainApplication
Other app call in ModalWindow:
http://webSite2.domain.com/mainApplication

I have the value returned from the modal window to the iFrame window
but I can not get the value returned to the parent window. The alert
in the parent window always returns undefined errors. Any help would
be much appreciated.

If the domains are completely different I don't think it can be done with
changing the "access data sources across domains" in the security settings, and
even then it may not work.
If the domains are as you wrote then you can set the document.domain property if
you can alter the page source.

http://msdn.microsoft.com/library/de...asp?frame=true
--

Joe (MVP)

https://mvp.support.microsoft.com/pr...8-8741D22D17A5
Jul 29 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Dag Sunde | last post: by
13 posts views Thread by Fernando Deutsch | last post: by
reply views Thread by Per0 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.