The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.
Send messages to iframe using iframeEl.contentWindow.postMessage
Recieve messages using window.addEventListener('message')
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>WebKit contentEditable focus bug workaround</title> | |
<script type='text/javascript' src='http://code.jquery.com/jquery-1.6.2.js'></script> | |
<script type='text/javascript'> | |
//<![CDATA[ | |
$(function(){ |