Skip to content

Instantly share code, notes, and snippets.

@9re
Forked from soundkitchen/wonderfl.js
Created July 8, 2010 06:09
Show Gist options
  • Save 9re/467693 to your computer and use it in GitHub Desktop.
Save 9re/467693 to your computer and use it in GitHub Desktop.
(function () {
var id = (function () {
var i, l, q, div, el, qs;
el = document.getElementsByTagName('SCRIPT');
el = el[el.length-1];
qs = el.src.split('?').pop().split('&');
l = qs.length;
for (i=0; i<l; i++) {
q = qs[i].split('=');
if (q[0]=='id') {
div = document.createElement('DIV');
div.appendChild(document.createTextNode('will replace with swf contents here.'));
div.setAttribute('id', q[1]);
el.parentNode.appendChild(div);
return q[1];
}
}
})();
var url = 'http://swf.wonderfl.net/swf/usercode' + /((((.).)..).*)/(id).slice(1).reverse().join('/');
//swfobject.createSWF({data: url, width: '640', height: '480'}, {}, id);
swfobject.embedSWF(url, id, '640', '480', '10');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment