Skip to content

Instantly share code, notes, and snippets.

@soundkitchen
Created July 8, 2010 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save soundkitchen/467618 to your computer and use it in GitHub Desktop.
Save soundkitchen/467618 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.setAttribute('id', q[1]);
el.parentNode.appendChild(div);
return q[1];
}
}
})();
var url = [
'http://swf.wonderfl.net/swf/usercode',
id.substr(0, 1),
id.substr(0, 2),
id.substr(0, 4),
id + '.swf',
].join('/');
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