Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2012
    Thanked 0 Times in 0 Posts

    Referencing jquery.js and other files properly?

    Hello. I am new here and am trying to get jquery to work in a simple web page. I am using the following tutorial (series):


    My problem is that it works if use the google hosted jquery.js file it works. However when I try to reference it to a file on my computer it isn't working. They are both exactly the same files, so I know I am not referencing it properly. I am using Ubuntu and the exact position of the jquery.js file is:


    For my script type code and source I used:

    <script type="text/javascript" src="/home/drew/Desktop/jqproj/js/jquery.js"></script>

    I have also tried:
    <script type="text/javascript" src="js/jquery.js"></script>

    The index.html file is in the /pracproj folder. The jquery.js file is in the /js folder which is inside of the /pracproj folder.

    What am I doing wrong?

  2. #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 932 Times in 919 Posts
    Why are you using your own copy of the library rather than one of the shared ones that your visitors are reasonably likely to already have on their computer so they don't have to download it.

    You should use a shared copy of jQuery such as the Google copy to speed up loading of your page.
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts