简体   繁体   English

如何将Tangle.js作为外部资源添加到jsfiddle

[英]How to add Tangle.js as an external resource to jsfiddle

trying to add Tangle.js library to jsfiddle and it's not working. 试图将Tangle.js库添加到jsfiddle中,但它不起作用。

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 缠结的网址是: http ://worrydream.com/Tangle/Tangle.js

We've added the URL to External Resources, but it's not picking it up. 我们已将该URL添加到“外部资源”中,但未选择该URL。 I've seen other posts about needing to link to CDN format - how would we do that? 我看过其他需要链接到CDN格式的帖子-我们将如何做?

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). 就像您说的那样,该库的URL是http://worrydream.com/Tangle/Tangle.js ,但是在您的jsfiddle中,您使用的是URL https://worrydream.com/Tangle/Tangle.js(https而不是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. 切换为通过HTTP而不是HTTPS加载jsfiddle(将URL更改为http而不是https),然后将Tangle库URL修复为HTTP版本。

External resources need to be loaded over HTTPS. 外部资源需要通过HTTPS加载。 When adding the resource, you see this message: 添加资源时,您会看到以下消息:

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

You would need to find a secure CDN that offers Tangle.js. 您将需要找到提供Tangle.js的安全CDN。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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