-1

I copied code from This JSBin Project on to my desktop into 3 files: index.html, style.css, script.js

I also included the lines in index.html:

 <link rel="stylesheet" href="style.css">
 <script type="text/javascript" src="script.js"></script>

but the script and style files don't seem to work when i open index.html in browser.

Awesome_girl
  • 484
  • 3
  • 9
  • 30
  • it looks like it should work correctly, did you copy the CSS and JS in the JSBin, and put it in style.css and script.js? – Jacob G Apr 07 '15 at 00:59

1 Answers1

1

jsBin by default omits the http: in the URI see more about protocol relative URL

<script src="//code.jquery.com/jquery.min.js"></script>

you need to add it:

<script src="http://code.jquery.com/jquery.min.js"></script>

and so for all other script and link tags (if you're viewing your page from file: environment)

See this jsBin http://jsbin.com/kumoyogegu/1/edit go to File > Download > and run it from desktop.

(Otherwise, by omitting http: you should correctly see your pages once uploaded to a live server or working from localhost)

Community
  • 1
  • 1
Roko C. Buljan
  • 196,159
  • 39
  • 305
  • 313