Closed ThoranCheLadra closed 9 years ago
Do you use var $ = window.$.noConflict(true);
in your script?
The following code works great:
// ==UserScript==
// @name test
// @include http://*
// @include https://*
// @include about:blank
// @require jquery.min.js
// ==/UserScript==
var $ = window.$.noConflict(true);
$(document.body).append('<h1>222222<h1/>');
$(document.head).prepend('<style>body {background-color: red;}<style>');
Issue was caused by unreachable statement when fetching asynchronously a css file, closing this. Thanks
Hi,
One of the features of our plugin is to add on-page controls, for which we have styles stored in stylesheet. In previous versions of Kango, we could simply include them by appending them to the page's HEAD with jQuery. This doesn't work anymore. I've tried other ways such as native javascript but no success so far; it appears. Below is a code snippet that worked on <= 1.7.7 and doesn't on 1.7.9:
kango.invokeAsync('kango.io.getExtensionFileContents', 'Content/css/cleanslate.css', function (content) { Logging.logDebug('Adding cleanslate css'); $(document.head).prepend(''); });
Cheers, Arthur.