Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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('','*');Advertisements