The random rantings of a concerned programmer.

Jan 10

JQuery and GreaseMoneky

Category: Random

I’m writing a tiny GreaseMonkey script for something, and I’m not going to lie — I fucking hate JavaScript. If I can’t use JQuery (which makes DOM manipulations somewhat reasonable), I’ll just fucking give up. Naturally, this means that, to effectively use GreaseMoneky, I need to load in JQuery.

And naturally, this means that there are only stupid bullshit ways to do that. Injecting a script element into the DOM is stupid. Embedding the entire JQuery library in your GreaseMoneky script is stupid. We want to fetch the fucking script and fucking run it:

GM_xmlhttpRequest({
    'method' : 'GET', 
    'url' : 'http://code.jquery.com/jquery-latest.js', 
    'onload' : function(jq) {
        eval(jq.responseText);

        /* ...JQuery shit here... */
    }
});

Now was that so bloody hard?

Also one of my housemates got me a couple fake cigarettes as a late Christmas gift. They’re effectively just pieces of cardboard and some painted copper (which reflects the light in such a way that it looks like it’s glowing) but they’re surprisingly realistic. I think I might start taking “smoke” breaks at my new job and see how long it takes them to notice that these aren’t actually cigarettes.

EDIT: WHEN THE FUCK DID I TURN INTO A FUCKING WEB DEVELOPER.


Tagged with: , ,
3 comments

3 Comments so far

  1. HMA January 10th, 2009 2:40 am

    > I fucking hate JavaScript
    I chortle’d.

  2. Anonymous January 10th, 2009 3:54 am

    I’m no WEB DEVELOPER, but isn’t there a minified version of http://code.jquery.com/jquery-latest.js that you should be fetching instead?

  3. Me January 15th, 2012 2:11 pm

    I FUCKING hate ECMAscript too. I refuse to call this scumbag scripting language after its psuedo name.

    It is a deceptive language and it’s too mutable. Every time you think you have the rules down, some quirky element is thrown in such as a “build-in” routine you didn’t even know existed.

    ECMAscript is too convoluted, mutable and excruciating to learn. I have not found a real teacher yet.

    Please spare yourselves dvd and cd tutorials, I find that no matter which brand I try the so called teachers end up flying through the lessons. I suspect that it is because they can’t even stand this bullshit language.

    Thanks for letting me vent. So,when can we vote ECMAscript out of existance?

Leave a comment