Followup to the long thread on javascript libraries.

Discussion in 'Javascript' started by Jim, Nov 3, 2007.

  1. Jim

    Jim Guest

    I don't wish to start another flame fest/name calling thread, but Matt's
    suggesion to use JQuery led me to try it.

    So I went to
    http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Setup and
    followed the directions to load the jquery.js file into the same
    directory as starterkit.html and custom.js, per " After downloading and
    extracting its content we put jquery.js into the same directory and open
    starterkit.html and custom.js with our favorite editor and
    starterkit.html with a browser."

    Then I added a small chunk of code to the starterkit.html file as
    suggested:

    <script type="text/javascript">

    $(document).ready(function() {
    // do stuff when DOM is ready
    });

    </script>^M

    Before I went any farther I decided to see what it looked like so I
    pointed my browser to http://localhost/starterkit/starterkit.html.

    I see a bunch of things, but I also see firebug complaining about 2 Errors:
    $ is not defined
    http://localhost/starterkit/starterkit.html#
    Line 751

    jQuery is not defined
    http://localhost/starterkit/custom.js
    Line 1


    I'm not one to trust a library that doesnt' even run its tutorial.

    I suspect I've done something stupid, but as far as I can see, I did
    what the tutorial said to do.

    Jim.
     
    Jim, Nov 3, 2007
    #1
    1. Advertising

  2. Jim

    Brian Adkins Guest

    On Nov 3, 10:32 am, Jim <> wrote:
    > I don't wish to start another flame fest/name calling thread,


    The tone of your post would suggest otherwise. It smelled funny, so I
    bothered to run through the tutorial myself. I had no problems.

    > So I went tohttp://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Setupand
    > followed the directions to load the jquery.js file into the same
    > directory as starterkit.html


    So, is jquery.js in the same directory? Or is jquery<some suffix>
    there instead? Did you notice the <script src="jquery.js" ... > line?

    > I see a bunch of things, but I also see firebug complaining about 2 Errors:
    > $ is not definedhttp://localhost/starterkit/starterkit.html#
    > Line 751


    Since '$' is defined by JQuery, and it's not defined in your case,
    wouldn't you expect that you haven't successfully loaded the JQuery
    code?

    > I'm not one to trust a library that doesnt' even run its tutorial.
    >
    > I suspect I've done something stupid, but as far as I can see, I did
    > what the tutorial said to do.


    So, you felt you did something stupid, and yet also felt comfortable
    spreading misinformation about it not "even run[ning] its tutorial"
    and being untrustworthy (in your eyes) ?

    Brian Adkins
     
    Brian Adkins, Nov 3, 2007
    #2
    1. Advertising

  3. Jim

    Jeff North Guest

    On Sat, 03 Nov 2007 10:32:03 -0400, in comp.lang.javascript Jim
    <>
    <hD%Wi.48906$> wrote:

    >| I don't wish to start another flame fest/name calling thread, but Matt's
    >| suggesion to use JQuery led me to try it.
    >|
    >| So I went to
    >| http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Setup and
    >| followed the directions to load the jquery.js file into the same
    >| directory as starterkit.html and custom.js, per " After downloading and
    >| extracting its content we put jquery.js into the same directory and open
    >| starterkit.html and custom.js with our favorite editor and
    >| starterkit.html with a browser."
    >|
    >| Then I added a small chunk of code to the starterkit.html file as
    >| suggested:
    >|
    >| <script type="text/javascript">
    >|
    >| $(document).ready(function() {
    >| // do stuff when DOM is ready
    >| });
    >|
    >| </script>^M
    >|
    >| Before I went any farther I decided to see what it looked like so I
    >| pointed my browser to http://localhost/starterkit/starterkit.html.
    >|
    >| I see a bunch of things, but I also see firebug complaining about 2 Errors:
    >| $ is not defined
    >| http://localhost/starterkit/starterkit.html#
    >| Line 751
    >|
    >| jQuery is not defined
    >| http://localhost/starterkit/custom.js
    >| Line 1
    >|
    >|
    >| I'm not one to trust a library that doesnt' even run its tutorial.
    >|
    >| I suspect I've done something stupid, but as far as I can see, I did
    >| what the tutorial said to do.


    If you followed the directions (and understood what you were doing)
    then the starterkit would run as expected.

    starterkit.html is referencing jQuery.js
    You would've downdloaded jQuery-1.2.1.js and copied it into your
    folder.

    You can either:
    1. rename the jQuery-1.2.1.js to jQuery.js
    2. change the reference from jQuery.js to jQuery-1.2.1.js

    Although, to help out the noobies, the page should've explained that
    you need to rename jQuery[latest version number].js to jQuery.js.
    -- -------------------------------------------------------------
    : Remove your pants to reply
    -- -------------------------------------------------------------
     
    Jeff North, Nov 4, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    682
    Eric Sosman
    Jul 8, 2003
  2. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,194
    Peter Shaggy Haywood
    Sep 20, 2005
  3. Mathieu Dutour

    long long and long

    Mathieu Dutour, Jul 17, 2007, in forum: C Programming
    Replies:
    4
    Views:
    478
    santosh
    Jul 24, 2007
  4. Bart C

    Use of Long and Long Long

    Bart C, Jan 9, 2008, in forum: C Programming
    Replies:
    27
    Views:
    805
    Peter Nilsson
    Jan 15, 2008
  5. veryhotsausage
    Replies:
    1
    Views:
    1,809
    veryhotsausage
    Jul 4, 2008
Loading...

Share This Page