1

Greetings fellow Greasemonkeys

I can't seem to wrap my head around this conundrum and it's making me want to pull out every single strand of hair I got.

In my userscript meta data I have the following

// @require     http://code.jquery.com/jquery-1.10.2.js
// @require     http://code.jquery.com/ui/1.11.0/jquery-ui.js
// @resource    myCss   http://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css        
// @grant       GM_addStyle
// @grant       GM_getResourceText

Followed by

var cssTxt = GM_getResourceText("myCss");
GM_addStyle(cssTxt);
var input = document.createElement("button");
input.setAttribute("id", "btn1");
document.body.insertBefore(input, document.body.firstChild);

$("#btn1").button({
        icons: {
            primary: "ui-icon-wrench"
        },
        text: false
    })
        .click(function (event) {
        alert("Hello World");
    });

Why is it that the little icon on the jquery button not show up? How am I using GM_getResourceText and GM_addStyle incorrectly

Your advise is greatly appreciated

PS: Running this code in jsFiddle yields results

irosh
  • 58
  • 1
  • 7
  • 1
    You were doing it right, but jQUI CSS has to be ``d for the background images to be loaded. I meant to answer this Q months ago but overlooked it. Sorry. – Brock Adams Aug 26 '14 at 10:44

0 Answers0