third-party libraries

Discussion in 'Javascript' started by josh, Aug 25, 2007.

  1. josh

    josh Guest

    Hi,
    any idea about what third-party library can I use to improve my
    Javascript UI

    YUI ?
    Google ?
    script.aculo.us ?

    or others?

    My goal is to use one that is power and widely used...

    Thanks
    josh, Aug 25, 2007
    #1
    1. Advertising

  2. josh

    Matt Kruse Guest

    On Aug 25, 12:48 pm, josh <> wrote:
    > any idea about what third-party library can I use to improve my
    > Javascript UI


    jQuery + Interface + (other plugins)

    Matt Kruse
    Matt Kruse, Aug 25, 2007
    #2
    1. Advertising

  3. Matt Kruse wrote:
    > On Aug 25, 12:48 pm, josh <> wrote:
    >> any idea about what third-party library can I use to improve my
    >> Javascript UI

    >
    > jQuery + Interface + (other plugins)


    jQuery is junk. It uses needless (and failing) browser detection, and it is
    based on Prototype.


    PointedEars
    --
    "Use any version of Microsoft Frontpage to create your site. (This won't
    prevent people from viewing your source, but no one will want to steal it.)"
    -- from <http://www.vortex-webdesign.com/help/hidesource.htm>
    Thomas 'PointedEars' Lahn, Aug 25, 2007
    #3
  4. josh

    Matt Kruse Guest

    On Aug 25, 1:24 pm, Thomas 'PointedEars' Lahn <>
    wrote:
    > jQuery is junk.


    Your "opinion" is without merit and in the minority.

    > It uses needless (and failing) browser detection


    Incorrect.

    > and it is based on Prototype.


    Incorrect.

    I've never in the history of this group seen code written by you that
    was superior to any part of jQuery. Your opinion is worthless.

    Matt Kruse
    Matt Kruse, Aug 25, 2007
    #4
  5. Matt Kruse wrote:
    > On Aug 25, 1:24 pm, Thomas 'PointedEars' Lahn <>
    > wrote:
    >> jQuery is junk.

    >
    > Your "opinion" is without merit and in the minority.


    See below.

    >> It uses needless (and failing) browser detection

    >
    > Incorrect.


    It used browser detection when I checked the code at 2007-08-12.

    > I've never in the history of this group seen code written by you that
    > was superior to any part of jQuery. Your opinion is worthless.


    Argumentum ad hominem. I think you can do better than that.


    PointedEars
    --
    Prototype.js was written by people who don't know javascript for people
    who don't know javascript. People who don't know javascript are not
    the best source of advice on designing systems that use javascript.
    -- Richard Cornford, cljs, <f806at$ail$1$>
    Thomas 'PointedEars' Lahn, Aug 25, 2007
    #5
  6. Matt Kruse wrote:
    > [...] Thomas 'PointedEars' Lahn [...] wrote:
    >> [jQuery] is based on Prototype.

    >
    > Incorrect.


    You're right, my bad. What is "Interface"?


    PointedEars
    --
    realism: HTML 4.01 Strict
    evangelism: XHTML 1.0 Strict
    madness: XHTML 1.1 as application/xhtml+xml
    -- Bjoern Hoehrmann
    Thomas 'PointedEars' Lahn, Aug 25, 2007
    #6
  7. Thomas 'PointedEars' Lahn wrote:
    > Matt Kruse wrote:
    >> On Aug 25, 1:24 pm, Thomas 'PointedEars' Lahn <>
    >> wrote:
    >>> jQuery is junk. [...] It uses needless (and failing) browser detection

    >> Incorrect.

    >
    > It used browser detection when I checked the code at 2007-08-12.


    And it still does:


    --jquery-1.1.4.js:825------------------------------------------------------
    /*
    * Whether the W3C compliant box model is being used.
    *
    * @property
    * @name $.boxModel
    * @type Boolean
    * @cat JavaScript
    */
    var userAgent = navigator.userAgent.toLowerCase();

    // Figure out what browser is being used
    jQuery.browser = {
    version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) ||
    [])[1], safari: /webkit/.test(userAgent),
    opera: /opera/.test(userAgent),
    msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
    mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
    };

    var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat";

    jQuery.extend({
    // Check to see if the W3C box model is being used
    boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
    styleFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat",

    --jquery-1.1.4.js:943-------------------------------------------------------
    var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?

    --jquery-1.1.4.js:1171------------------------------------------------------
    // Do a quick check for the existence of the actual ID attribute
    // to avoid selecting by the name attribute in IE
    // also check to insure id is a string to avoid selecting an
    element with the name of 'id' inside a form
    if ( (jQuery.browser.msie||jQuery.browser.opera) && oid &&
    typeof oid.id == "string" && oid.id != m[2] )

    --jquery-1.1.4.js:1402------------------------------------------------------
    // For whatever reason, IE has trouble passing the window object
    // around, causing it to be cloned in the process
    if ( jQuery.browser.msie && element.setInterval != undefined )
    element = window;

    --jquery-1.1.4.js:1569------------------------------------------------------
    // Clean up added properties in IE to prevent memory leak
    if (jQuery.browser.msie)
    event.target = event.preventDefault = event.stopPropagation =
    event.handler = event.data = null;

    --jquery-1.1.4.js:1604------------------------------------------------------
    // check if target is a textnode (safari)
    if (jQuery.browser.safari && event.target.nodeType == 3)
    event.target = originalEvent.target.parentNode;

    --jquery-1.1.4.js:1737------------------------------------------------------
    // Remove event listener to avoid memory leak
    if ( jQuery.browser.mozilla || jQuery.browser.opera )
    document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );

    --jquery-1.1.4.js:1765------------------------------------------------------
    // If Mozilla is used
    if ( jQuery.browser.mozilla || jQuery.browser.opera )
    // Use the handy event callback
    document.addEventListener( "DOMContentLoaded", jQuery.ready, false );

    // If IE is used, use the excellent hack by Matthias Miller
    //
    http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
    else if ( jQuery.browser.msie ) {

    --jquery-1.1.4.js:1792------------------------------------------------------
    } else if ( jQuery.browser.safari )

    --jquery-1.1.4.js:2104------------------------------------------------------
    // Determines if an XMLHttpRequest was successful or not
    httpSuccess: function( r ) {
    try {
    return !r.status && location.protocol == "file:" ||
    ( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
    jQuery.browser.safari && r.status == undefined;
    } catch(e){}
    return false;
    },

    // Determines if an XMLHttpRequest returns NotModified
    httpNotModified: function( xml, url ) {
    try {
    var xmlRes = xml.getResponseHeader("Last-Modified");

    // Firefox always returns 200. check Last-Modified date
    return xml.status == 304 || xmlRes == jQuery.lastModified || jQuery.browser.safari && xml.st... as application/xhtml xml -- Bjoern Hoehrmann
    Thomas 'PointedEars' Lahn, Aug 25, 2007
    #7
  8. Matt Kruse meinte:

    >> jQuery is junk.

    >
    > Your "opinion" is without merit and in the minority.


    So... Given its market penetration: Internet Explorer is the best
    browser? Right?

    > I've never in the history of this group seen code written by you that
    > was superior to any part of jQuery. Your opinion is worthless.


    Hmmm... Makes opinions of all kind of critics useless. The film critic
    who is no director, the book critic who is no author (or maybe only an
    "average" one), restaurants, fashion, art, etc.

    Bashing Thomas might be fun, but your "arguments" stink (particularly in
    this context).

    Gregor


    --
    http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
    http://www.licht-blick.at ::: Forum für Multivisionsvorträge
    http://www.image2d.com ::: Bildagentur für den alpinen Raum
    Gregor Kofler, Aug 25, 2007
    #8
  9. josh

    Matt Kruse Guest

    On Aug 25, 3:31 pm, Thomas 'PointedEars' Lahn <>
    wrote:
    > > It used browser detection when I checked the code at 2007-08-12.

    > And it still does:


    Your statement was:
    : jQuery is junk. [...] It uses needless (and failing) browser
    detection

    I wasn't disputing that it uses browser detection. I was disputing
    that it is needless and failing.

    Browser detection is not ideal, but the reality is that in some cases
    it works and is the most prudent way to accomplish a task in a
    generalized, cross-browser way. Only in fringe cases (often where the
    user is deliberately trying to create a problem) does it usually fail.

    > If you still need a reason why not to use jQuery in its present state:
    > "compressed": 22679 bytes


    22k is trivial. Smaller than many images, yet it packs considerable
    power. Simply stating the size of a library without presenting any
    arguments is meaningless.

    >>> [jQuery] is based on Prototype.

    >> Incorrect.

    >You're right, my bad.


    No need to state the obvious.

    > What is "Interface"?


    It's a jQuery plugin that creates many animation and UI effects.

    Matt Kruse
    Matt Kruse, Aug 25, 2007
    #9
  10. josh

    Matt Kruse Guest

    On Aug 25, 3:38 pm, Gregor Kofler <> wrote:
    > > Your "opinion" is without merit and in the minority.

    > So... Given its market penetration: Internet Explorer is the best
    > browser? Right?


    I said nothing about market penetration. The fact is that there are
    many expert javascript developers in the world who have much more
    experience and knowledge than Mr. P. Ears, and I don't know of any
    that would classify jQuery as "junk". Even among his peers (average
    javascript hackers) his opinion would be in the minority.

    I won't even touch the IE "argument". I've been developing for the web
    for 15 years - long enough to have heard every debate under the sun a
    thousand times. Nothing is as simple as it seems.

    > Hmmm... Makes opinions of all kind of critics useless. The film critic
    > who is no director, the book critic who is no author (or maybe only an
    > "average" one), restaurants, fashion, art, etc.


    Mr. Ears has no credibility in this forum or on any topic in
    javascript. He is not a film critic who is not a director - he has
    published code and samples in the past, none of which I have found to
    be impressive in the least. He does claim to be a javascript expert,
    yet fails to demonstrate it. He's a film critic who _has_ tried to
    make films and failed miserably, yet continues to tell others how to
    do it "right". One should not critique something that one obviously
    does not understand.

    > Bashing Thomas might be fun, but your "arguments" stink (particularly in
    > this context).


    Bashing P.E. isn't fun. I only followup on this topic for fear that
    someone else would find his arguments and stay away from jQuery
    because of his baseless remarks.

    Matt Kruse
    Matt Kruse, Aug 25, 2007
    #10
  11. Matt Kruse meinte:

    >> Hmmm... Makes opinions of all kind of critics useless. The film critic
    >> who is no director, the book critic who is no author (or maybe only an
    >> "average" one), restaurants, fashion, art, etc.

    >
    > Mr. Ears has no credibility in this forum or on any topic in
    > javascript. He is not a film critic who is not a director - he has
    > published code and samples in the past, none of which I have found to
    > be impressive in the least. He does claim to be a javascript expert,
    > yet fails to demonstrate it. He's a film critic who _has_ tried to
    > make films and failed miserably, yet continues to tell others how to
    > do it "right". One should not critique something that one obviously
    > does not understand.


    "...has no credibility on this forum (sic!)..."
    "...published nothing I found impressive in the least..."
    "...failed miserably..."
    "...does not understand (Javascript)..."

    Maybe you should put it "I think TL is an obnoxious dork, who I
    thoroughly despise." Sounds equally substantial. Put him in your
    killfile (Randy Webb should do the same) and everything will be good again.

    Gregor


    --
    http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
    http://www.licht-blick.at ::: Forum für Multivisionsvorträge
    http://www.image2d.com ::: Bildagentur für den alpinen Raum
    Gregor Kofler, Aug 26, 2007
    #11
  12. Matt Kruse wrote:
    > On Aug 25, 3:31 pm, Thomas 'PointedEars' Lahn wrote:
    >>> It used browser detection when I checked the code at
    >>> 2007-08-12.

    >> And it still does:

    >
    > Your statement was:
    > : jQuery is junk. [...] It uses needless (and failing)
    > browser detection
    >
    > I wasn't disputing that it uses browser detection.


    But using browser detection is the most telling indicator of bad code
    that exists.

    > I was disputing
    > that it is needless and failing.


    The examples cited by Thomas show lots of evidence that the browser
    detection used is needless, for example:-

    | --jquery-1.1.4.js:1604---------------------------------------------
    | // check if target is a textnode (safari)
    | if (jQuery.browser.safari && event.target.nodeType == 3)
    | event.target = originalEvent.target.parentNode;

    - where the logic implemented is that is the browser appears to be
    safari and the event.target is a text node then it should be replaced
    with the parent of the original target, suggesting that the subject node
    should be an element node not a text node. But why only when the browser
    is safari? If event.target's being a text node is a problem on safari
    shouldn't it also be a problem on any browser where it is a text node?

    The logic here betrays a mindset that is thinking in terms of supporting
    a limited set of browsers and then adding branches with the idea of
    adding single browsers to that set, but in taking that approach has
    become fixated on the browsers being added to the extent of being
    blinded to the general problem.

    And when I see:-

    | --jquery-1.1.4.js:1402----------------------------------------------
    | // For whatever reason, IE has trouble passing the window object
    | // around, causing it to be cloned in the process
    | if ( jQuery.browser.msie && element.setInterval != undefined )
    | element = window;

    - I am reading a comment that shouts of programming by mystical
    incantation.

    > Browser detection is not ideal,


    It is unreliable and technically bass-less.

    > but the reality is that in some cases
    > it works


    Things that are unreliable tend to work in some cases, it is the cases
    where they don't work that makes them unreliable.

    > and is the most prudent way to accomplish a task in a
    > generalized,


    Wanting to do things in a generalised way is itself a decision that
    introduces available problems, and there are very few real-world
    situations (beyond the questionable wisdom of attempting to create
    general libraries) that are general.

    > cross-browser way.


    That is precisely what using browser detection renders impossible. The
    best that could be achieved is multi-browser, as we see here in this
    JQuery code.

    > Only in fringe cases (often where the
    > user is deliberately trying to create a problem) does it
    > usually fail.

    <snip>

    You are trying to blame the user for the unreliability that results form
    a script author using a technique that is technically baseless and
    self-evidently flawed? It may be a convenient excuse for incompetence,
    but it does not really excuse it at all.

    Richard.
    Richard Cornford, Aug 26, 2007
    #12
  13. Gregor Kofler wrote:
    <snip>
    > Put him in your killfile (Randy Webb should do the same)
    > and everything will be good again.


    No, that is not a good idea at all. Any significant use of killfiles
    will eventually result in there being multiple independent cultures
    within the group, with each unaware of what the other(s) are saying or
    doing. That will be extremely confusing to newcomers, and would result
    in a great deal of nonsense going uncorrected/challenged, to the overall
    determent of credibility of the group as a whole.

    Richard.
    Richard Cornford, Aug 26, 2007
    #13
  14. Richard Cornford meinte:
    > Gregor Kofler wrote:


    >> Put him in your killfile (Randy Webb should do the same)
    >> and everything will be good again.

    >
    > No, that is not a good idea at all.


    [snip]

    Generally agreed. However, I suppose Thomas being in Matt Kruse's or
    Randy Webb's killfile won't do any harm to the discussions, since they
    just deliver insults as responses to Thomas' postings.

    That's IMO simply childish and cut off otherwise interesting threads.
    How about Matt Kruse having his "jQuery + Interface + (other plugins)"
    explained in detail?

    Gregor


    --
    http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
    http://www.licht-blick.at ::: Forum für Multivisionsvorträge
    http://www.image2d.com ::: Bildagentur für den alpinen Raum
    Gregor Kofler, Aug 26, 2007
    #14
  15. josh

    Matt Kruse Guest

    On Aug 26, 11:10 am, "Richard Cornford" <>
    wrote:
    > But using browser detection is the most telling indicator of bad code
    > that exists.


    Well, I wouldn't go _that_ far, but I do agree that in most cases it
    is a sign of a programmer who hasn't thought through the problem
    enough.

    > | --jquery-1.1.4.js:1604---------------------------------------------
    > | // check if target is a textnode (safari)
    > | if (jQuery.browser.safari && event.target.nodeType == 3)
    > | event.target = originalEvent.target.parentNode;
    > But why only when the browser
    > is safari? If event.target's being a text node is a problem on safari
    > shouldn't it also be a problem on any browser where it is a text node?


    Good question. I will raise some of these questions to the developers,
    because I am curious to know the reasoning as well. Surely they are
    not perfect and would be open to code improvements. I've never dug
    deep into the browser-sniffing portions of the library to try to
    justify their existence, but rather trusted that the developers had
    done so already and had technical reasons for coding how they did. But
    I may be able to contribute to improving the code, perhaps. I know
    you're probably not interested in improving the code, but if you have
    any other specific criticisms I would like to hear them.

    > > Browser detection is not ideal,

    > It is unreliable and technically bass-less.


    Are you saying it lacks low-frequency tones or a certain type of fish?
    ;)

    > > cross-browser way.

    > That is precisely what using browser detection renders impossible. The
    > best that could be achieved is multi-browser, as we see here in this
    > JQuery code.


    Perhaps it could be improved. Also consider that jQuery's intent is
    always to add unobtrusive scripting to an otherwise plain-html page,
    so if there are problems in some browsers that end up not being
    supported, the existing non-scripted page should still work.

    > You are trying to blame the user for the unreliability that results form
    > a script author using a technique that is technically baseless and
    > self-evidently flawed?


    No - if a user configures their browser to lie about what it is, then
    they should expect unpredictable results. In the absence of users
    trying to purposely confuse the code, I've been extremely happy with
    the cross-browser capabilities of jQuery and I've yet to come across a
    real-world situation where it failed to work as expected.

    Matt Kruse
    Matt Kruse, Aug 26, 2007
    #15
  16. josh

    Matt Kruse Guest

    On Aug 26, 1:47 pm, Gregor Kofler <> wrote:
    > Generally agreed. However, I suppose Thomas being in Matt Kruse's or
    > Randy Webb's killfile won't do any harm to the discussions, since they
    > just deliver insults as responses to Thomas' postings.


    I rarely post to this group anymore, but it is true that I
    occasionally get drawn into a battle with Thomas that I should just
    let go. Reading his history of posts in this group easily shows why he
    has earned the reputation he has here, however. And it's not just with
    Randy and myself. It's difficult to let someone with such a lack of
    perspective and technical experience "get the last word" on topics
    where people are looking for advice that they can take with them and
    actually use in something productive. I would hate for people doing
    google searches and finding his replies to think they has is some de-
    facto expert in this field and take his opinions more seriously than
    they warrant.

    > How about Matt Kruse having his "jQuery + Interface + (other plugins)"
    > explained in detail?


    What more do you want to know? Going to jquery.com and also finding
    the Interface plugin/examples should be all anyone needs to get going
    if they are interested.

    Matt Kruse
    Matt Kruse, Aug 26, 2007
    #16
  17. Matt Kruse meinte:

    >> How about Matt Kruse having his "jQuery + Interface + (other plugins)"
    >> explained in detail?


    > What more do you want to know? Going to jquery.com and also finding
    > the Interface plugin/examples should be all anyone needs to get going
    > if they are interested.


    The OP wanted to know which 3rd party library to use (though he didn't
    state any requirements). IMO you should at least elaborate somewhat on
    the whys of your ..er... recommendation.

    Threads in other groups sound similar:

    "best camera?"
    > "canon!"
    >> "canon 's crap"
    >>> "idiot. haven't seen any good pix from you. you don't have a clue"

    ....

    Gregor

    --
    http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
    http://www.licht-blick.at ::: Forum für Multivisionsvorträge
    http://www.image2d.com ::: Bildagentur für den alpinen Raum
    Gregor Kofler, Aug 26, 2007
    #17
  18. Matt Kruse wrote:
    > [...] Thomas 'PointedEars' Lahn [...] wrote:
    >> If you still need a reason why not to use jQuery in its present state:
    >> "compressed": 22679 bytes

    >
    > 22k is trivial. Smaller than many images, yet it packs considerable
    > power. Simply stating the size of a library without presenting any
    > arguments is meaningless.


    The library could be much smaller if it did not so much needless browser
    detection. That said, jQuery is mostly an implementation if XPath; as
    several DOMs have built-in XPath support, it is unreasonable not to make use
    of that. See the XPath one-liner I posted recently; with jQuery that would
    have included the download of at least 22k to work in the supported
    environments.

    >>>> [jQuery] is based on Prototype.
    >>> Incorrect.

    >> You're right, my bad.

    >
    > No need to state the obvious.


    In contrast to several other people who post here, I have a sense of decency
    left, and feel compelled to apologize when I went awfully wrong. Call me
    old-fashioned.


    PointedEars
    --
    Prototype.js was written by people who don't know javascript for people
    who don't know javascript. People who don't know javascript are not
    the best source of advice on designing systems that use javascript.
    -- Richard Cornford, cljs, <f806at$ail$1$>
    Thomas 'PointedEars' Lahn, Aug 26, 2007
    #18
  19. josh

    Matt Kruse Guest

    On Aug 26, 3:24 pm, Thomas 'PointedEars' Lahn <>
    wrote:
    > jQuery is mostly an implementation if XPath;


    "Mostly"? It does considerably more than XPath.

    > several DOMs have built-in XPath support, it is unreasonable not to make use
    > of that.


    http://docs.jquery.com/DOM/Traversing/Selectors#XPath_Selectors

    > with jQuery that would
    > have included the download of at least 22k to work in the supported
    > environments.


    If you're only going to use a selector to grab elements, using jQuery
    may very well be over-kill. But that's not really a criticism of the
    library.

    Matt Kruse
    Matt Kruse, Aug 26, 2007
    #19
  20. josh

    Guest


    > Wanting to do things in a generalised way is itself a decision that
    > introduces available problems, and there are very few real-world
    > situations (beyond the questionable wisdom of attempting to create
    > general libraries) that are general.
    >


    A very generalized statement, ironically.

    Conceptual reuse is what language itself is based upon.

    Creating a sentence, or a program statement is general knowledge.

    Building a kitchen. Imagine, what if the builder had a mistake and put
    the toilet next to the refrigerator!

    In the code world, we have great things like frameworks. Now in Java,
    there is Spring. Spring is great.

    In JavaScript, we have a lot of libraries. They're all buggy.

    My only problem with them is that they are all proprietary.

    Can you use Yahoo event system with jQuery Ajax transport with a Dojo
    widget?

    >
    > That is precisely what using browser detection renders impossible. The
    > best that could be achieved is multi-browser, as we see here in this
    > JQuery code.
    >
    > > Only in fringe cases (often where the
    > > user is deliberately trying to create a problem) does it
    > > usually fail.

    >
    > <snip>
    >
    > You are trying to blame the user for the unreliability that results form
    > a script author using a technique that is technically baseless and
    > self-evidently flawed? It may be a convenient excuse for incompetence,
    > but it does not really excuse it at all.
    >

    Typical.

    > Richard.
    , Aug 27, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kieran Benton
    Replies:
    3
    Views:
    493
    Ray Cassick \(home\)
    Sep 11, 2003
  2. Thato
    Replies:
    2
    Views:
    411
    Jack Klein
    Aug 18, 2004
  3. Deep_Feelings
    Replies:
    6
    Views:
    234
  4. Baggio Nepembe

    third party libraries in C

    Baggio Nepembe, Feb 20, 2010, in forum: C Programming
    Replies:
    0
    Views:
    450
    Baggio Nepembe
    Feb 20, 2010
  5. Don69
    Replies:
    1
    Views:
    354
    Roedy Green
    Apr 10, 2010
Loading...

Share This Page