Skip to content

Instantly share code, notes, and snippets.

View hiepxanh's full-sized avatar

hiepxanh hiepxanh

View GitHub Profile
@pbojinov
pbojinov / README.md
Last active December 8, 2023 21:09
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@shimondoodkin
shimondoodkin / WebKit contentEditable focus bug workaround.html
Created July 13, 2011 19:28
WebKit contentEditable focus bug workaround
<!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(){