www.webdeveloper.com
Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24

Thread: on click change css property

  1. #16
    Join Date
    Nov 2010
    Posts
    1,082
    hmmm... not a very compelling argument, really. A framework is just a bunch of helper functions, written in javascript and loaded from an external file. Or are helper functions and external files "improper" too?

  2. #17
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,318
    I know that but the fact remains that a framework is not javascript programming.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  3. #18
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    so the symphony orchestra is not music in comparison with a guitar solo and blowjob is not sex compared with coition, right?
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  4. #19
    Join Date
    Nov 2010
    Posts
    1,082
    Quote Originally Posted by Padonak View Post
    blowjob is not sex compared with coition, right?
    ha, ha. I think if you spend your time worrying about what is "real" javascript you probably shouldn't be fussy about the other

  5. #20
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    in russian there exist the rude widly used word (a curse) which has many meanings depending on the context it is used. so, if you say 'i have [Present Perfect Simple of that word] with that code' everybody will understand how hard the work was )) the word is mostly equal to the english 'f*ck' ))))
    Last edited by Padonak; 07-01-2013 at 11:47 AM.
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  6. #21
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,318
    You're taking the argument out of context.

    Code:
    $(document).ready(function() {
     
     $("#one").hide();
     $("#two").hide();
     $("#three").hide();
    is not javascript.

    $() is a function that replaces javascript and is a function that can easily be written using javascript without relying on a tool to get the job done.

    .ready() is another function (prototype) that replaces the onload event.

    Why not do it in javascript and learn how to script rather than rely on others to program a framework helper tool that is itself prone to bugs.

    As for the orchestra / guitar solo comparison, music is music no matter how big your band is, javascript is javascript and not a framework. That is the difference.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  7. #22
    Join Date
    Nov 2010
    Posts
    1,082
    Quote Originally Posted by \\.\ View Post
    $() is a function that replaces javascript
    an extremely poor choice of words - we already went over this - jQuery is written in javascript - it doesn't replace it - if anything it just adds to it.

    Quote Originally Posted by \\.\ View Post
    and is a function that can easily be written using javascript without relying on a tool to get the job done.
    depends - alot of jQuery functionality has ready parallels to vanilla js. But some of it is very useful, particularly for things like traversing the DOM. I'd like to see a one-line equivalent to this in plain javascript:
    Code:
    var depth = $(this).parents("div[class='subsections']").length;
    Quote Originally Posted by \\.\ View Post
    .ready() is another function (prototype) that replaces the onload event.
    mmm... nope. Actually, .ready() replaces the modern "DOMContentLoaded" and the old-fashioned IE "onreadystatechange", but even then it's not that simple. You can google, or look at the jQuery source if you really want to understand how it works

    Quote Originally Posted by \\.\ View Post
    Why not do it in javascript and learn how to script rather than rely on others to program a framework helper tool that is itself prone to bugs.
    do you advise carpenters to throw out all their tools except for a hammer and a screwdriver because they are "real" and everything else is derivative? You choose the best tools for the job - programming is science after all, and dogma has no place in science.

    One of the benefits of jQuery is that it was created pretty much as a whole, taking into account the flaws of javascript (of which there are many) and the differences in browser implementation (ditto). Javascript on the other hand has evolved messily over the years, and adheres to its own "standards" (which browser manufacturers are free to ignore, and they do - and we're not just talking IE here, either)

    Should people not learn the basics of javascript and rely only on jQuery? No, that would be stupid. But should they ignore all the possibilities that jQuery offers just because it's "improper"? That would be equally stupid...

  8. #23
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,318
    Sorry but unless you know what came before, having a framework will not be a substitute for programming.

    How many rails programmers understand the underlying code that it uses? Same goes for all these frameworks, unless you know the underlying methods, a framework programmer will be lost if they are faced with swathes of script that they have no idea what it does.

    As for var depth = $(this).parents("div[class='subsections']").length; is not about putting things in one line, its about construction code to do jobs that are needed and only when needed on that particular page. With a framework you have the problem of adding weight to a page when you find that the majority of that code in the framework is not needed but is loaded.

    What may be a cost benefit to the programmer using the tool is not to the web browser / user loading it.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  9. #24
    Join Date
    Nov 2010
    Posts
    1,082
    Quote Originally Posted by \\.\ View Post
    Sorry but unless you know what came before, having a framework will not be a substitute for programming. [etc]
    kind of like what I said in the final paragraph of my last post

    that argument about frameworks adding weight to page load used to have some substance, but the latest minified version of jQuery comes in at 91kb... just a little over twice the size of the image file for that ad over on the right there, and not really the sort of load that even an older gen smartphone would notice...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles