
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Cross domain HTML5 iframe issue
Use the postMessage method for transferring data across different domains.
Example
You can try the following code snippet to solve the cross-domain HTML5 iframe issue −
// Using postMessage() window.onmessage = function(e) { e.source.postMessage(document.body.innerHTML, e.origin); }; window.onmessage = function(event) { alert(e.data); }; // fire document.getElementById('frame1').contentWindow.postMessage('','*');
- Related Questions & Answers
- HTML5 Cross Browser iframe post message - child to parent?
- Alternatives to HTML5 iframe srcdoc?
- Cross-origin data in HTML5 Canvas
- Is their any alternative to HTML5 iframe srcdoc?
- HTML5 Canvas & z-index issue in Google Chrome
- Is their a cross-origin attribute in HTML5?
- Phonegap + Windows Phone 8 : HTML5 viewport meta & scaling issue
- What is the usage of the cross-origin attribute in HTML5?
- HTML5 appcache with Safari causing cross-site css to not load correctly
- HTML DOM iFrame Object
- How to allow the restricted resources from another domain in web browser with HTML5
- Selenium and iframe in html.
- Troubleshoot the download issue from internet
- Differentiate between domain and domain name server and components of DNS
- Domain-Key Normal Form
Advertisements