0

I have 4 different files I downloaded from here -->

http://codepen.io/wallaceerick/pen/fEdrz/

Its an upload button styled with css and javascript.

According to this post (How do i combine html, css and javascript coding to make my carousel work?)

I put everything into 4 seperate files and referenced them in the html file. But I still can't get it to work, maybe you guys can help me find my mistake.

HTML:

<!DOCTYPE html>
<html lang"en">
  <head>
    <meta charset="utf-8">
    <title>...</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <script src="jscript.js"></script>
    <script src="jquery-2.0.0.min.js"></script>
  </head>
  <body>
  <h1>Custom File Upload <span>With jQuery and CSS</span></h1>

<div class="custom-file-upload">
    <!--<label for="file">File: </label>-->
    <input type="file" id="file" name="myfiles[]" multiple />
</div>
  </body>
</html>

The 3 other files (jscript.js, style.css and jquery-2.0.0.min.js) are in the same directory and have the exact names like in the HTML file. When i try opening it locally with Chrome, it doesn't work. Where is my mistake?

Community
  • 1
  • 1
Monacco Franze
  • 1,541
  • 1
  • 11
  • 12
  • You got the right idea. Usually, you'd want to put the custom stuff last, since it overwrites the extensions/plugins. So basically, jscript.js would be after jquery. And style.css would be after any other front end framework you include (which doesn't apply to you in this case). Other than that, just make sure your paths are correct. – KidBilly Feb 02 '15 at 21:53
  • At the very least, you need to put the `jquery-2.0.0.min.js` line before the `jscript.js` line, since the latter *uses* jQuery. Are you seeing any errors in the Javascript console? [How to open the JavaScript console in different browsers?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers) – Paul Roub Feb 02 '15 at 21:53
  • move the `` above the `jscript `one – Pedro Estrada Feb 02 '15 at 21:53
  • 1
    You may need to move the jscript.js to the bottom of the document depending on how it is initialized. – Kevin Boucher Feb 02 '15 at 21:56

0 Answers0