Why is the code on jsfiddle.net not working in jsbin.com?

蹲街弑〆低调 提交于 2019-12-24 04:34:09

问题


I make my own language using codemirror, what I want to do when I stop on name of function and hover on it or press on (Ctrl+I) to show tooltip display the type and other data for this function, the code run on jsfiddle.net but not run on jsbin.com

 var cm = CodeMirror(document.getElementById("editor"), {
    value: "function myScript() {\n    return 100;\n}",

    indentUnit: 4,
    lineNumbers: true
});

var textMarker;

$('#add').click(function() {
    textMarker = cm.markText({
        line: 1,
        ch: 4
    }, {
        line: 1,
        ch: 10
    }, {
        className: 'marked-text'
    });

    $('.marked-text').tooltip({
        title: 'This is a return statement',
        container: 'body',
        delay: { "show": 500, "hide": 100 },
        animation: false
    });
});

$('#remove').click(function() {
    if (textMarker) {
        textMarker.clear();
    }
});

The link to working code: here code works

My try but not work: my try


回答1:


Try adding libraries under "external resources" from jsfiddle to jsbin.

Edit: Yes you're right you added the libraries. I made it work putting JQuery as the first script since you can't load bootstrap before JQuery. Then change the http to https.



来源:https://stackoverflow.com/questions/42467975/why-is-the-code-on-jsfiddle-net-not-working-in-jsbin-com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!