0

jQueryとユーザースクリプトを使用してテーブルデータの値を変更しようとしていますが、うまくいきません。これが私のコードです:

// ==UserScript==
// @name       My Fancy New Userscript
// @namespace  http://use.i.E.your.homepage/
// @version    0.1
// @description  enter something useful
// @copyright  2012+, You
// ==/UserScript==


// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
  var script = document.createElement("script");
  script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
  script.addEventListener('load', function() {
    var script = document.createElement("script");
    script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
    document.body.appendChild(script);
  }, false);
  document.body.appendChild(script);
}

// the guts of this userscript
function main() {
  // Note, jQ replaces $ to avoid conflicts.
 $('.last').html('111');
}

// load jQuery and execute the main function
addJQuery(main);

私は何を間違っていますか?Chrome 30.0.1599.69 で Tampermonkey 拡張機能を使用しています

4

1 に答える 1