Followup to the long thread on javascript libraries.

J

Jim

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.
 
B

Brian Adkins

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 said:
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
 
J

Jeff North

| 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.
-- -------------------------------------------------------------
(e-mail address removed) : Remove your pants to reply
-- -------------------------------------------------------------
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top