V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lukaevans707
V2EX  ›  程序员

Json.Cat

  •  
  •   lukaevans707 · 309 天前 · 940 次点击
    这是一个创建于 309 天前的主题,其中的信息可能已经有所发展或是发生改变。

    重金买了个域名 json.cat

    放着吃灰挺可惜 贡献给 xdm 了

    期待有大神能来开发下 没广告就行

    这是自己 2 行代码写的 主要突出一个快!

        <body>
            <main>
                <textarea id="source" autofocus placeholder="Source"></textarea>
                <textarea id="target" readonly placeholder="Format"></textarea>
            </main>
        </body>
        <script>
            const source = $("#source")
            const target = $("#target")
            source.keyup(() => {
                try {
                    const text = source.val()
                    if (text.trim() == '') {
                        target.val("")
                    } else {
                        const json = JSON.parse(text)
                        const tree = JSON.stringify(json, null, '\t')
                        target.val(tree)
                    }
                } catch (e) {
                    target.val(e.message)
                }
            })
        </script>
    

    https://github.com/Uatrix/Json.Cat

    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2589 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:20 · PVG 21:20 · LAX 06:20 · JFK 09:20
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.