I want to add an "info div" on a website. For this, I add some html via a Tampermonkey script:
// ==UserScript==
// @name New script
// @namespace http://tampermonkey.net/
// @version 1.1
// @description try to take over the world!
// @author You
// @match http://www.monsite.com/*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_listValues
// @grant GM_addStyle
// @grant GM_getResourceText
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js
// @require https://code.jquery.com/ui/1.11.4/jquery-ui.min.js
// ==/UserScript==
/* jshint -W097 */
'use strict';
var html = "<div id='myDiv'>CONTENT</div>";
$('body').append(html);
$(function() {
$( "#myDiv" ).draggable();
});
When I try to move it, I got a console error :
Uncaught TypeError: n.style is not a function
For information, I got the same issue if I want to use $.slideToggle()..
Any idea how to fix this ?
Thanks