SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    uk colchester
    Posts
    177
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jquery getting started help

    I have decided I need to get to grips with this and I cant even get off the ground heres my problem.

    If I link to the jquery file like this: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>

    My examples work, if I download the jquery.js file and link to it locally like this:

    <script src="jquery.js" type="text/javascript"></script>

    Things stop working, I have double checked the file location moved the file location redownloaded the file copied the file from another site which worked ok but what ever I do when the file is pointed to locally it wont work.

    Am I missing some basic rule or can this only be a fact that somehow its not poitning to the jquery.js file I have tried everything.

    Or can someone send me over a zip folder including a basic html file linked to a jquery file with a basic working example.

    I had started following the tutorial here http://docs.jquery.com/Tutorials:How_jQuery_Works


    Many thanks

    Ian

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Code HTML4Strict:
    <script src="jquery.js" type="text/javascript"></script>
    is looking for the .js file in the same folder/directory as the .html file calling it. Is this where you have the .js file?

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    uk colchester
    Posts
    177
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes indeed it is. Have the html file and the .js file all in the same folder.

    Totally confused why it wont work

    Cheers

  4. #4
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Make sure it did not save the .js file with a .txt extension. I just download it and I ended up with: jquery-1.3.2.js.txt

    If this is not the answer just post again.
    Last edited by RetroNetro; Nov 23, 2009 at 19:09. Reason: spelling

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should be able to manually type the address into your browser to load the file at the expected url. Once you do that, it either becomes obvious that another issue is preventing direct viewing, or you had the url path wrong.

  6. #6
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    uk colchester
    Posts
    177
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well there was a problem with the extension, i had .js.js on the end, so I sorted that but still it did not work, I typed the full path into the browser url on my c drive and could view the file so everything as fasr as I can see should be in place for this to work.

    I have zipped up my file with the html and .js file included in the hpoe so one can see what I am doing wrong.

    Many thanks for all help so far.

    Cheers

    Ian
    Attached Files Attached Files

  7. #7
    SitePoint Addict
    Join Date
    Apr 2007
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not that this will solve your problem but I would suggest having the files in their respective folder.

    Project Folder

    index.html - all html files
    /js - all js files
    /css - all css files
    /image - all images
    /support - any supporting files such as documents or photoshop layouts etc.

  8. #8
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    uk colchester
    Posts
    177
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by semantic7 View Post
    Not that this will solve your problem but I would suggest having the files in their respective folder.

    Project Folder

    index.html - all html files
    /js - all js files
    /css - all css files
    /image - all images
    /support - any supporting files such as documents or photoshop layouts etc.
    Yes normally I would I just added the .JS file in the top folder to simplify things while I work out why it cant be read, I had started out with it in a file called javascript.

    Anyway my next question while I work out why why it cant be read is there any reasons why I cant link to the one on google which works perfect at this url
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>

    is it likely that will be removed or renamed stopping and jquery in the future from working just wondered what the convention is on that question as everything works perfect when I link to that file.

    Thanks again


    Ian

  9. #9
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That is strange that it is still not working. I have no idea about that link to a jquery file on google.

    Here is a working example:
    Last edited by RetroNetro; Jan 22, 2010 at 21:55.

  10. #10
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    uk colchester
    Posts
    177
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the working file that works a treat this end and also thanks to everyone who has helped really appreciated.

    Cheers

    Ian


Bookmarks

Posting Permissions

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