Lack of javascript understanding
Hi All
I have just started my first asp.net application in years and have to go through the relearning process after years doing windows work.
I am really struggling with javascript in particular.
Can anyone give me a brief description of the following code:
Code:
$(function () {
$("input:submit").button();
$("input:button").button();
});
I am so unfamiliar with this syntax. What is the $ for?
Also, can anyone suggest a good site for javascript?
Thanks In Advance:wave:
Re: Lack of javascript understanding
That javascript is using a javascript library. Most likely jQuery, the part inside the brackets is a selector and is applying this .Button() function to the selected items to enhance them.
Re: Lack of javascript understanding
Thanks Fishy
Still dont know what your talking about but I am an idiot and I will figure it out.:-)
Re: Lack of javascript understanding
As a quick summary.....
That javascript (Written using jQuery) is making all html button and submit controls (selected using selectors input:submit and input:button) look nicer by calling the jQuery UI function (.Button()).
In unrelated news a friend of mine recently gave their new born son "Bede" as his middle name. Clearly named after your good self.
Re: Lack of javascript understanding
i suggest you learn the basics of javascript before learning a library like jQuery. have a look at this link to get started
http://www.w3schools.com/js/js_intro.asp
Re: Lack of javascript understanding
Quote:
Originally Posted by
Nitesh
I am not sure that I agree with that.
jQuery and other libraries like it, take away a lot of the "problems" with JavaScript and replace it with a very "fluent" way of accessing the HTML DOM and manipulating the contents of your page.
If you are just starting out, then I would suggest starting to learn jQuery, and once you are happy with it, then you can start looking into JavaScript (heck, ECMAScript if you really want to) to see how the innards work.
Gary
Re: Lack of javascript understanding
Quote:
Originally Posted by
gep13
I am not sure that I agree with that.
jQuery and other libraries like it, take away a lot of the "problems" with JavaScript and replace it with a very "fluent" way of accessing the HTML DOM and manipulating the contents of your page.
If you are just starting out, then I would suggest starting to learn jQuery, and once you are happy with it, then you can start looking into JavaScript (heck, ECMAScript if you really want to) to see how the innards work.
Gary
hey gary,
I agree with you;). I was meaning the absolute basics for someone just starting of. Stuff like the syntax etc. From personal experience, I was a desktop app developer and I was thrown into web development one day. I never had a chance to learn the basic javascript stuff. I just picked up on it as I went along. I sometimes wish I had started from the ground up as I sometimes get stuck on the basics:lol: