By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,505 Members | 1,165 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,505 IT Pros & Developers. It's quick & easy.

Iframe ReturnValue returns undefined if domains are not the same

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a

"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.