Greasy Fork is available in English.

microjungle JsonML to DocumentFragment

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

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/25520/241821/microjungle%20JsonML%20to%20DocumentFragment.js

Aŭtoro
Spooky Donkey
Versio
3
Kreita
2016/12/08
Ĝisdatigita
2018/01/08
Licenco
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"));