Skip to content

Instantly share code, notes, and snippets.

@zoharbabin
Created February 5, 2014 21:44
Show Gist options
  • Save zoharbabin/8833820 to your computer and use it in GitHub Desktop.
Save zoharbabin/8833820 to your computer and use it in GitHub Desktop.
JavaScript Close Event for Player iframe Plugin: http://player.kaltura.com/docs/LimeSurvey (this should be called from within the LimeSurvey's close message window)
<script>
function getUrlParams() {
var params = { };
document.referrer.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(str,key,value) {
params[key] = value;
});
return params;
}
var params = getUrlParams();
parent.postMessage(JSON.stringify( { 'status':'ok', 'playerId': params.playerId} ), '*' );
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment