473,396 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

IFrame Cross Domain Communication - FireFox?

55
Hello

Can anyone here please guide me with the Cross Domain Communication between IFrames.

Problem:

Application1 running on IIS => http://localhost.ad.local/Applicaiton1
Application2 running on Apache => http://localhost.ad.local:8080/Application2

The Application2 is being loaded in an IFrame inside Application1; and there needed a communication beetween the two Applications. With IE my application works but with FireFox it doesnt.

I have tried with several available tips like changing the document.domain property etc., but it doesnt seems to work. I am not able to get the objects from Application2 which is in an IFrame.

Can anyone please guid me with this issue.

Thanks & regards,
Hash
Dec 13 '09 #1
3 5335
rnd me
427 Expert 256MB
firefox provides several ways to communicate between cross-domain frames.

look into postMessage and window.name specifically.
Dec 14 '09 #2
Could you please, provide more information and maybe some code in order us to be able to help to you?

Thanks

-------------------------------------
[removed link]
Dec 15 '09 #3
hash4sp
55
Hi Carmarri !

I created test pages.
1. Page1.html calls Page2.html in an Iframe.
2. Page1.html is hosted on IIS
3. Page2.html is hosted on Apache
4. Now i want to access a variable named "aTestVariable" of Page2 from Page1.
5. This works perfectly in IE, but the problem is in FireFox.

Thanks !

Code as follows:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Page1.html  
  3. (http://localhost/app1/page1.html - app1 virtual dir on IIS)
  4. ----------------
  5. <html>
  6. <head>
  7. <title></title>
  8. <script type="text/javascript" language="JavaScript">
  9.  
  10. function checkIframeVar() {
  11.      var IframeMap = parent.document.getElementById('IframeContainer"');
  12.     //alert("IframeMap.contentWindow = " + IframeMap.contentWindow);
  13.     alert("IframeMap.contentWindow.aTestVariable = " + IframeMap.contentWindow.aTestVariable);
  14.  
  15. }
  16.  
  17. </script>
  18. </head>
  19.  
  20. <body>
  21.  
  22. <h1>Welcome</h1></br>
  23. <div>Parent Page</div> <br>
  24. <iframe id="IframeContainer" width="562" height="522" src="http://localhost:8080/app2/page2.html"></iframe>
  25. <input type="button" value="CallGlobalVar" onclick="checkIframeVar();"/>
  26.  
  27. </body>
  28. </html>
  29.  
Expand|Select|Wrap|Line Numbers
  1. Page2.html 
  2. (http://localhost:8080/app2/page2.html - app2 Virtual dir on Apache)
  3. -----------
  4. <html>
  5. <head>
  6. <title>Iframe Child</title>
  7.  
  8. <script type="text/javascript" language="JavaScript">    
  9.  
  10. var aTestVariable = "H e l l o";
  11.  
  12. </script>
  13. </head>
  14. <body>
  15.     <h1>H E L L O </h1> </br>
  16.     <div id='poDiv'>
  17.     WebPage in IFrame
  18.     </div>
  19. </body>
  20. </html>
  21.  
Dec 16 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: aatcbbtccctc | last post by:
Hi folks I've googled for an answer to this, with no success. Can someone please jump in, and put me out of my misery! (I'm sure it's quite simple) I have an invisible IFRAME, and a visible...
3
by: GSL | last post by:
Hello, I'm building an application that will be incorporated into existing websites. I'd like to use the IFrame tag to accomplish this, but now I'm having second thoughts based on all of the...
4
by: Venkatesh | last post by:
Hello All, I have an iframe in my main html and within iframe, I'm loading another HTML webpage. In my main html page, I've captured the mouse click event, by setting the "onclick" for <bodyof...
11
by: vunet.us | last post by:
Since XMLHTTP Request does not support loading of XML from other servers, I decided to use a trick: load XML into hidden iframe and then get that XML with JavaScript to parse. But, is this a good...
1
by: totalstranger | last post by:
Has anyone found a reasonable, simple way to determine the height of variable length embedded data in a cross-domain IFRAME? I'm not interested in reading or viewing the data in the IFRAME, I...
3
by: visu | last post by:
Hi , I need a solution for my problem with IFRAME in firefox. The problem is that i ve to make the IFRAME to increase in its height to displays its whole content dynamically .i ve set...
7
by: Tom Cole | last post by:
IFrames have been used by years for people to accomplish many of the tasks the XMLHttpRequest does for them now...I unfortunately am late in the game and XMLHttpRequest was already out there by the...
9
by: Lee | last post by:
Hi all, We need to create a page where we detect the finish of a game that's hosted on another site. We thought of doing it with frames, where we would put the game in an iframe that is...
23
by: vunet | last post by:
It is recommended by some sources I found to create IFrames in IE using document.createElement('<iframe src="#">') instead of document.createElement('iframe'). Why and what browser versions to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.