473,569 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IFrame Cross Domain Communication - FireFox?

55 New Member
Hello

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

Problem:

Application1 running on IIS => http://localhost.ad.lo cal/Applicaiton1
Application2 running on Apache => http://localhost.ad.lo cal: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 5343
rnd me
427 Recognized Expert Contributor
firefox provides several ways to communicate between cross-domain frames.

look into postMessage and window.name specifically.
Dec 14 '09 #2
carmarri
5 New Member
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 New Member
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 "aTestVaria ble" 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
11154
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 DIV: <IFRAME id=myframe style="display:none" src="..." onload="ShowNews(this)"></IFRAME>
3
1521
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 negative comments I've seen regarding IFrames. Is there an alternative method to allow a page to seamlessly access another site?
4
25080
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 main page. The code is like this: <body onclick="handleClickEvent(event)"> ....
11
8577
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 idea? I am stuck. How do I get XML loaded in the iframe and pass it on to JS function for parsing? Thank you.
1
1390
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 simply want to make sure it's displayed without a scrollbar. To date all my efforts have been rejected with a security violation, although I can set...
3
18541
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 scrolling=0 ,i dont want the scroll bars to appear in the IFRAME. I ve achieved this somehow thru javascript in IE.. but it is not working in Firefox.. is...
7
9622
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 time I got serious about using Javascript for more than just rollover images... I now would like to learn about the concept for the purposes of...
9
8799
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 contained in our page. All we need to do is to READ the location.href of that iframe (which is again, from anohter domain, not our domain) - but we can't! ...
23
6562
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 use it? IE5 or IE6? Thanks
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.