Created
July 26, 2011 17:24
-
-
Save jeremyBanks/1107277 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Example from http://stackoverflow.com/q/6834930 | |
// @version 1.3 | |
// @namespace http://stackoverflow.com/q/6834930 | |
// @description An example, adding a border to a post on Stack Overflow. | |
// @include http://stackoverflow.com/questions/2246901/* | |
// ==/UserScript== | |
var load,execute,loadAndExecute;load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},loadAndExecute=function(a,b){return load(a,function(){return execute(b)})}; | |
loadAndExecute("//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js", function() { | |
$("#answer-6834930").css("border", ".5em solid black"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment