1. Santosh Vaza
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2010
    Rep Power

    Jquery Alternative.

    Hi guys.
    I liked jquery very much specially it helps you to select the elements by using css selectors.

    but in my projects i am using the jquery only for selecting the elements and only its couple methods(2 or 3) are worth to me.
    I think its useless to put a 16 KB file on your page if you are using only its .val() method for getting the value of HTML elements. Does any one knows any jquery plugin or any open souorce js which provides me the elements object when i invoke it using css selector , For example
    #('#txtTD')-> this will give me the object
    #('#txtTD').value -> will give me the value of object.

    i googled around but only found this.

    no one can become perfect by merely ceasing the act
  2. #2
  3. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    A Land Down Under
    Rep Power
    If you're really that worried about the size (16kb is not tiny, but it's really not that big either), why not take the jQuery code and remove the parts that you don't need and leave only the parts that you do? That will give you the functionality that you want, along with the smallest possible file size.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2006
    I'm sneaking up behind you.
    Rep Power
    If you want to get the value of an input element with an id, why not use plain javascript? document.getElementById('txtTD').value ...
    Why do we always seek someone, something or some thought? Are we afraid of ourselves?
  6. #4
  7. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    USA (verifiably)
    Rep Power
    Try using Sizzle JS. It's actually the sector engine that jQuery uses.

    Originally Posted by Catacaustic
    why not take the jQuery code and remove the parts that you don't need and leave only the parts that you do?
    Easier said than done.
    Spreading knowledge, one newbie at a time.

    Learn CSS. | PHP includes | HTML Validator | CSS validator

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  8. #5
  9. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Sep 2007
    outside Washington DC
    Rep Power
    Setup your pages to download jQuery minimized from Google's content distribution system. For most of your users, it will be cached, as lots of software is built on jQuery, so you can just use the copy loaded for some other Web 2.0 site. Zero download for your application.

    It becomes a "once only" cost that may only have to happen a couple of times a year. That's trivial.

    Comments on this post

    • Kravvitz agrees
    • Winters agrees
  10. #6
  11. Cunning Linguist
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2003
    I used to live at home, now I stay at the house
    Rep Power
    Moved from the Lounge...
    Support requests via PM will be ignored!
    Read These: The General Rules Thread | The General FAQ Thread | NEW USERS - How to post a question

IMN logo majestic logo threadwatch logo seochat tools logo