Skip to content

Instantly share code, notes, and snippets.

@astrotars
Created February 14, 2013 23:35
Show Gist options
  • Select an option

  • Save astrotars/4957391 to your computer and use it in GitHub Desktop.

Select an option

Save astrotars/4957391 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
(function(d, id) {
var tag,
tid = 'mvmt',
ref = d.getElementsByTagName('script')[0];
if (!d.getElementById(tid)) {
tag = d.createElement('iframe');
tag.id = tid;
tag.src = '//sweeps-dashboard.herokuapp.com' + '/app?id=' + id;
tag.setAttribute('frameborder', 'no');
ref.parentNode.insertBefore(tag, ref);
}
window.addEventListener('message', function(e) {
for (var attr in e.data) {
tag.setAttribute(attr, e.data[attr]);
}
});
})(document, 'SWEEPSTAKES_ID');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment