Results 1 to 7 of 7

Thread: Lack of javascript understanding

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    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

    Parksie

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    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.

  3. #3

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Resolved 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.:-)

    Parksie

  4. #4
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    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.

  5. #5
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    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

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Lack of javascript understanding

    Quote Originally Posted by Nitesh View Post
    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
    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

  7. #7
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: Lack of javascript understanding

    Quote Originally Posted by gep13 View Post
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width