AL-zami
AL-zami

Reputation: 9076

how to add external style sheet and js files to jsfiddle

i am trying to create a fiddle which includes an external css style sheet and an external javascript file which .it had an option in the left panel called external resources.how this option can be used to add those external files?do i need to upload the external files to somewhere.if i need to would you please give me the link where i can upload this.

HTML:
<html>
<head>
<link rel="stylesheet" type="text/css" href="games.css">
</head>
<body>
<div id="mydiv">
<canvas id="mycanvas1"></canvas>
<canvas id="mycanvas2"></canvas>
</div>
<script src="script.js"></script>
</body>
</html>

CSS:

*{margin:0px;padding:0px;}
#mydiv{
width:100%;
height:100%;
background-color:black;
}
#mycanvas1{
width:500px;
height:500px;
background-color:white;
border:1px solid white;

}

Upvotes: 1

Views: 5732

Answers (2)

coder
coder

Reputation: 13248

If you refer something like jquery plugins or jquery ui or simply jquery plugin and other optional css which are taken from other websites where you would like to use it for your reference in your page you need to add those links which you are seeing it on you left side of jsfilddle.

For ex: <script src="http://somewebsite.com/yourfile.js"></script>

you need to add "yourfile.js" to your hosting server and the refer it as

http://somewebsite.com/yourfile.js in the exernal js file in fiddle

Upvotes: 1

user1864610
user1864610

Reputation:

If you want to load an external resource in JsFiddle you need to place it somewhere that JsFiddle can find it.

For example, if you have a website http://www.example.com you could place your external file in the web root so that it has a URL of http://www.example.com/resource.css. That's the value you put in the external resources field on JSFiddle.

You'll need to upload your files to somewhere - JSFiddle doesn't have access to your hard disk. Where you put it is something you'll have to decide for yoursefl.

Upvotes: 2

Related Questions