0

I trying to reproduce a hardcopy version of a jsfiddle I made:

http://jsfiddle.net/bsapaka/5fv9B/25/

I am having trouble getting the javascript to work. My HTML head has the following:

<script src="jquery-2.0.3.min.js"></script>

<script src="my-tabs.js"></script>

"my-tabs.js" contains the javascript from the jsfiddle. Both files are in the same directory as the HTML file.

3
  • 1
    And you did download those files and place them in the same path as the current page, and check the filenames etc. Commented Dec 10, 2013 at 22:30
  • Do jquery-2.0.3.min.js and my-tabs.js both exist in the same directory as the file containing the HTML? edit nevermind, just saw your line at the bottom. Commented Dec 10, 2013 at 22:31
  • both files are in the same directory, yes paths are correct Commented Dec 10, 2013 at 22:32

1 Answer 1

2

Your fiddle has the javascript executed onLoad - but your html has the script inside the head - which is where the difference lies.

Wrap all the code in your my-tabs.js with a

$(function() {
   /* your code here. */
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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