Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Followup to the long thread on javascript libraries.

Reply
Thread Tools

Followup to the long thread on javascript libraries.

 
 
Jim
Guest
Posts: n/a
 
      11-03-2007
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:Get...h_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.
 
Reply With Quote
 
 
 
 
Brian Adkins
Guest
Posts: n/a
 
      11-03-2007
On Nov 3, 10:32 am, Jim <(E-Mail Removed)> 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



 
Reply With Quote
 
 
 
 
Jeff North
Guest
Posts: n/a
 
      11-04-2007
On Sat, 03 Nov 2007 10:32:03 -0400, in comp.lang.javascript Jim
<(E-Mail Removed)>
<hD%Wi.48906$(E-Mail Removed)> 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:Get...h_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.
-- -------------------------------------------------------------
http://www.velocityreviews.com/forums/(E-Mail Removed) : Remove your pants to reply
-- -------------------------------------------------------------
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having compilation error: no match for call to (const __gnu_cxx::hash<long long int>) (const long long int&) veryhotsausage C++ 1 07-04-2008 05:41 PM
VERY late followup - Why batteries in Walkmans don't last for very long. thanatoid Computer Support 0 01-01-2008 05:54 AM
unsigned long long int to long double Daniel Rudy C Programming 5 09-20-2005 02:37 AM
Very Long - How to Tweak the PrintFix Scanner - (Followup to another thread) BobS Digital Photography 8 01-27-2005 09:38 PM
Assigning unsigned long to unsigned long long George Marsaglia C Programming 1 07-08-2003 05:16 PM



Advertisments