Skip to content

Instantly share code, notes, and snippets.

@dayvsonlima
Forked from mattsnider/hashHackSender.js
Last active August 29, 2015 14:16
Show Gist options
  • Save dayvsonlima/3e5d0a90419944a3dede to your computer and use it in GitHub Desktop.
Save dayvsonlima/3e5d0a90419944a3dede to your computer and use it in GitHub Desktop.
var HashHack = {
PREFIX: '#hhMessage=',
postMessage: function(el, sMessage) {
if ('string' === typeof el) {
el = document.getElementById(el);
}
var sUrl = el.src.replace(/#.*/, '');
el.src = sUrl + HashHack.PREFIX + encodeURIComponent(sMessage);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment