試圖將Tangle.js庫添加到jsfiddle並且它不工作。如何添加Tangle.js作爲jsfiddle的外部資源
小提琴是here
代碼是:
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的糾結是:http://worrydream.com/Tangle/Tangle.js
我們添加的URL外部資源,但它沒有拿起它。我已經看到其他文章需要鏈接到CDN格式 - 我們將如何做到這一點?
你可以使用github cdn鏈接https://cdn.rawgit.com/worrydream/Tangle/master/Tangle.js – yurzui
真棒 - 謝謝。 –