简体   繁体   中英

How to add Tangle.js as an external resource to jsfiddle

trying to add Tangle.js library to jsfiddle and it's not working.

Fiddle is here

Code is:

   var tangle = new Tangle (document.getElementById("bedroomcostcalculator"), {
    initialize: function () {
        this.bedrooms = 2;
        this.cost = 300000;
        this.costperbedroom = 150000;
        },
update: function () {
        this.cost = this.bedrooms * this.costperbedroom;
       }
});

URL for Tangle is: http://worrydream.com/Tangle/Tangle.js

We've added the URL to External Resources, but it's not picking it up. I've seen other posts about needing to link to CDN format - how would we do that?

As you said, the URL for the library is http://worrydream.com/Tangle/Tangle.js , but in your jsfiddle, you're using the URL https://worrydream.com/Tangle/Tangle.js (https instead of http).

That second link simply doesn't work.

Switch to loading your jsfiddle via HTTP instead of HTTPS (change the URL to http instead of https) and then fix the Tangle library URL to the HTTP version.

External resources need to be loaded over HTTPS. When adding the resource, you see this message:

添加不安全资源时从JSFiddle弹出

You would need to find a secure CDN that offers Tangle.js.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM