Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 13th, 2012  |  syntax: None  |  size: 0.91 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // ==UserScript==
  2. // @name         user.js template
  3. // @namespace    http://hoge.co.jp/
  4. // @include      http://foo.com/*
  5. // @exclude
  6. // @author       xorphitus
  7. // @description  this is a template of user script
  8. // @version      0.0.1
  9. // ==/UserScript==
  10.  
  11. (function () {
  12.     'use strict';
  13.  
  14.     var main = function () {
  15.         // TODO
  16.     };
  17.  
  18.     if (jQuery) {
  19.         main();
  20.     } else {
  21.         (function (callback) {
  22.             var script = document.createElement('script');
  23.             script.setAttribute('src', 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');
  24.             script.addEventListener('load', function () {
  25.                 var script = document.createElement('script');
  26.                 script.textContent = '(' + callback.toString() + ')();';
  27.                 document.body.appendChild(script);
  28.             }, false);
  29.             document.body.appendChild(script);
  30.         }(main));
  31.     }
  32.  
  33. }());