microjungle JsonML to DocumentFragment

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

当前为 2018-01-08 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://updategreasyfork.deno.dev/scripts/25520/241821/microjungle%20JsonML%20to%20DocumentFragment.js

作者
Spooky Donkey
版本
3
创建于
2016-12-08
更新于
2018-01-08
大小
1.4 KB
许可证
暂无

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"));