Build Your Own Business Website header image

Thesis Design Options – When to Use the Java Script Libraries

Difficulty Level -

Filed Under Topics - ,

Listed Under Lesson Subjects -

Whoops, you've found some premium content!

Watch the opening clip of this video to preview it,
the full video is available to paid members.

In this session we discuss what the Javascript libraries are in the Thesis theme and when to use them. The Javascript libraries can be found under Thesis Design Options. They compress that library to an unreadable file in order to reduce the amount of load. The bottomline is, when you are writing your own Javascript, anything you check in the Javascript libraries is what’s being called in it.

Video Transcript

Member: Now you mentioned, if you wouldn’t mind, if we could go to the Thesis theme Site Options… because you mentioned jQuery and this is one thing I could never figure out exactly. You’ve got the… just so you know, I’m going there. You click on something and it’s like you can add libraries like jQuery and all the stuff. When would I use that? I don’t understand. Like for certain plugins or whatever… I think it’s Site Options and it says something like add to jQuery library or something… when would I do that when I’m using a… like, I’ve never had to use it in 2 ½ years. So I’m wondering, like when you would use that additional scripts. Is that it? No. I think maybe it’s under Design Options.

Rick: I think it must be under Design Options.

Member: Yeah. It’s usually lower left.

Rick: Javascript, sitewide javascript libraries.

Member: There you go. So I don’t understand, like what am I supposed to do with those things? When would I check them off?

Rick: Well, you would mostly use these only when you are writing your own custom javascript.

Member: Okay and then if I clicked it and I… what are these things do? I’m not even sure what they do. If I click off that one jQuery, the top one, what is that supposed to be doing?

Rick: Well, let’s see what happens, just for grins.

Member: Okay.

Rick: In the first place, jQuery is automatically loaded by WordPress. So if we view the page source here, jQuery is being loaded where? Javascript… here it is. Okay so this script type javascript, this right here, this is being loaded automatically by WordPress. So there’s jQuery.

Member: Okay gotcha.

Rick: Now if we come back over here and we say load jQuery and hit save. I’m not absolutely…

Member: You haven’t hit… you didn’t hit save last time.

Rick: No, I didn’t. No, I didn’t.

Member: Okay, I’m just kind of…

Rick: I want to compare the difference.

Member: That’s a nice little site you’re putting together there. I mean, it’s got a nice banner and everything. This is How to Create a Professional Website using the Thesis theme.

Member: Right, okay.

Rick: Here’s jQuery here again, exactly the same way. These are two different source views, but it’s exactly the same. So in fact, this didn’t have any effect whatsoever because jQuery’s already called. However, jQuery UI is not called. So then we could say, okay let’s add jQuery UI.

Member: Nice. You didn’t hit save. I don’t think you’d hit save. Okay, go ahead.

Rick: We’ll just give it a second here. And then when we refresh this again and view the page source, let’s see… where is jQuery UI? Okay, there’s our jQuery. Oh you know what, I wouldn’t be surprised if jQuery UI got added down here at the bottom. It did. So what they did was, he added jQuery UI down here at the bottom and he added it from the Google library. So he didn’t add the one that’s on your site. This is hosted off at Google. Whereas this jQuery stayed the set that’s included in your WordPress site. Actually, let’s go down at the bottom and see if he changed that. It would be horrible practice. He did.

Okay so the moral of the story is you never want to check jQuery because it’s loading jQuery twice from 2 different locations. And that’s never a good thing to do because it can confuse the daylights out of people and it loads extra stuff. So you never want to click this one because this is being added by WordPress. This one, you might, if you’re going to use UI everywhere and the same thing is true with Scriptalicious or MooTools or Dojo. These are just different libraries that you might want to use as a programmer. So the plugins are already going to call the libraries they need. So you would only do this in the case of, you’re going to write your own jQuery code. You’re going to rely on jQuery UI and this just allows you to include it.

Member: Okay.

Rick: But otherwise, there’s no use in it other than that.

Member: Okay, right. So… right. If you’re coding your own stuff… now are they all… yeah, they’re all javascript, I guess, apparently.

Rick: These are all javascript libraries so they are like jQuery.

Member: And when you say javascript library, it’s like you know, files that contain functions that you’re going to call in your own javascript, thinks like that, classes and functions or something?

Rick: Yes, it’s exactly it. Although what they do is, in order to reduce the amount of load, what they do is they take that library and they compress it into an unreadable file and minify it and compress it and send it off. And I mean, you could try to read it but you wouldn’t get very far but that’s what it is.

Member: Oh okay, I’m… go ahead.

Rick: And nobody intends to read this either right? If you need to know how to use jQuery, you’d learn how to use jQuery. You don’t really need to learn what the jQuery code looks like.

0 Comments… add one

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
Subscription Options
0 comments… add one

Leave a Comment