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?

4
  • 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. Commented Feb 2, 2015 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? Commented Feb 2, 2015 at 21:53
  • move the <script src="jquery-2.0.0.min.js"></script> above the jscript one Commented Feb 2, 2015 at 21:53
  • 1
    You may need to move the jscript.js to the bottom of the document depending on how it is initialized. Commented Feb 2, 2015 at 21:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.