Last active
May 10, 2016 21:28
-
-
Save nickbarnwell/d5192457cb1851fd620daea4961fe023 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function postMessageAndHashbang(obj) { | |
var msg = ""; | |
if(typeof obj === "object" && obj.smsupsell.postmessagevalue != null) { | |
msg = obj.smsupsell.postmessagevalue; | |
} else { | |
msg = obj; | |
}; | |
parent.postMessage(JSON.stringify({smsupsell: {postmessagevalue: msg}}), "*"); | |
history.pushState({}, "", "#!"+msg); | |
window.location = window.location; //Don't ask… | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment