Large

Hype Machine download links

By tonyskn Last update Sep 9, 2011 — Installed 30,258 times.

Unpack the Javascript?

in
Subscribe to Unpack the Javascript? 3 posts, 2 voices



alexabreu User

Any chance you'd be willing to unpack your Javascript so it's more readable?

 
alexabreu User

oops. is the packed stuff just jquery?

i was used to this:

// Add jQuery
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://jquery.com/src/jquery-latest.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);

// Check if jQuery's loaded
function GM_wait() {
if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); }
else { $ = unsafeWindow.jQuery; letsJQuery(); }
}
GM_wait();

// All your GM code must be inside this function
function letsJQuery() {
alert($); // check if the dollar (jquery) function works
}

 
electblake User
FirefoxMacintosh

yes, the packed stuff was just jquery. instead of including jquery in the dom, it just included the jquery library itself in the script.

the real glory is in plain text.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel