Greasy Fork is available in English.

microjungle JsonML to DocumentFragment

Based on https://github.com/deepsweet/microjungle by Kir Belevich

Dieses Skript sollte nicht direkt installiert werden. Es handelt sich hier um eine Bibliothek für andere Skripte, welche über folgenden Befehl in den Metadaten eines Skriptes eingebunden wird // @require https://update.greasyfork.org/scripts/25520/241821/microjungle%20JsonML%20to%20DocumentFragment.js

Autor
Spooky Donkey
Version
3
Erstellt am
08.12.2016
Letzte Aktualisierung
08.01.2018
Lizenz
n/a

const mj = new MicrojungleJsonMLtoDocumentFragment();
const jm = [["div", {class: "fun"}, "hello"]];
mj(jm).firstElementChild.outerHTML === "<div class=\"fun\">hello</div>";//true


const mj = new MicrojungleJsonMLtoDocumentFragment();
const jm = [["div", {id: "appendedNode"}, "hello"]];
mj(jm, document.querySelector("#appendToThis"));