External resources in JSFiddle (Adding Twitter Boo

2019-01-21 21:56发布

问题:

I am trying to replicate my issue with JSFiddle but when needed frameworks not supported natively, I believe I will need to import them from external resources. However, clicking + won't open up anything and I am not sure what to do with the URI field.

The simple question is, I particularly need to embed Bootstrap.

How do I embed Bootstrap in JSFiddle?

回答1:

BootstrapCDN is supported by JSFiddle, you just need to paste in the relevant URLs.

In the external resource field/box enter each of these URLs* and hit +:

http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css
http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js

The result of which is: http://jsfiddle.net/v9ec3/1/

Which then allows you to post your HTML/CSS/JS as required. Edit away and click update when finished to give you a URL that you can paste anywhere (including here!). Note you don't need to reference it via link.

****Note:** The above bootstrap version URLs (2.3.2) are pasted from http://www.bootstrapcdn.com at the time of the question*



回答2:

Use Https instead of http as it jsfiddle allows only https. Please check it down here

https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js



回答3:

For a more general solution to this (not only Bootstrap but many other JavaScript libraries), I found cdnjs very helpful: Go to cdnjs, search for your library, copy the URl and paste it in the "External Resources" field of your fiddle.



回答4:

I do something like this: @import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');