Jump to content

What Language Is This?


Renegade605

Recommended Posts

I'm wondering what language this is, the <script> tag says JavaScript but I've never seen JS like this before.

<script type="text/javascript">//Remove skin selector//<![CDATA[$("#foot_themechooser").remove();$(".c_desc:contains('Theme Settings')").next().remove();$(".c_desc:contains('Theme Settings')").remove();//]]></script>

If it is JS, why is there no mention of this 'format' in the w3schools tut?

Link to comment
Share on other sites

He is talking about this libraryhttp://jquery.com/They are defining a function, the same way you would using $ instead of a name like someName(), if you wanted to create your function that isn't built-in. I also think that the $ is suppose to be a shorthand way of typing document.getElementsByTagName, getElementById, etc. with some other methods for it.

Link to comment
Share on other sites

The jQuery $() function is actually flexible enough to accept CSS-style selectors, e.g. using . and #, as well as some custom functions [e.g. contains()].

Link to comment
Share on other sites

Since jquery is a third-party add-on, and has its own documentation on its site, the school here has no need to document it.Using a framework like jquery (and there are many others) is a big decision. They tend to be pretty comprehensive, giving you simplified access to techniques that would take you a long time to develop on your own. And there are design agencies that work extensively with them, so knowing one or more can (sometimes) increase your chances of employment (if that's something you want).At the same time, I notice that some people (not all) who rely on frameworks often don't realize where javascript and the DOM end and the framework begins. So they may become dependent on a thing they don't fully understand. Users who come HERE with lots of jquery questions rarely get satisfactory answers. (Though they can on other forums.)Then there is the cost in time of downloading the framework scripts along with the rest of your code. If you only want to use 1-2 features of the framework in a project, and the framework library is not easily broken into modules, you may end up with a sluggish download for a very small payoff.And of course there is the learning curve. Learning a framework can take as much time and practice as learning the DOM.

Link to comment
Share on other sites

Thanks for the replies. I first saw this on the support board for the Zathyrus ZetaBoards systems. Their forums have the jQuery framework built in (which I didn't know). As for not knowing where the DOM and framework meet, I'd like to consider myself a fairly competant JS user, so I think I can manage. And as far as downloading time goes, it's built in, so I see no reason not to use it.Thanks again,

Link to comment
Share on other sites

And as far as downloading time goes, it's built in, so I see no reason not to use it.
No it's not... not on new sites at least. You have to include the jQuery framework to use the jQuery functions. Do you mean to say you'll be editing a site that already uses jQuery?BTW, the "$" is just an identifier that happens to be legal in JavaScript - http://www.authenticsociety.com/blog/JavaScript_DollarSign
Link to comment
Share on other sites

Google also hosts the jquery API, in addition to several others:http://code.google.com/apis/ajaxlibs/documentation/The only advantage of linking to the Google version is that if your visitor has been to any other site that also uses the Google version, then the code will already be cached and they won't need to download it again for your site.Also, chances are it will download a lot faster from Google than from your server.

Link to comment
Share on other sites

No it's not... not on new sites at least. You have to include the jQuery framework to use the jQuery functions. Do you mean to say you'll be editing a site that already uses jQuery?
Yes, the Zathyrus Networks ZetaBoards forum system has jQuery built in.justsomeguy: thanks, bookmarked
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...