[OT] book - jQuery

I

imbirek8

Hi,

I woudl like to learn jQuery library. I don't know very well javascript,
dom, css.

I'm looking for book with easy describe jQuery library and other important
elements from this subject.
Can you recommend me any good book ?

Thanks for help
 
D

David Mark

Hi,

I woudl like to learn jQuery library. I don't know very well javascript,
dom, css.

If you don't know the DOM, then what makes you think you need jQuery?
Did some other neophyte tell you it would make the DOM faster, more
concise, etc.?
I'm looking for book with easy describe jQuery library and other important
elements from this subject.
Can you recommend me any good book ?

No. There is none. Search the archives of this group for more
information about jQuery.

[snip]
 
J

Jeremy J Starcher

Hi,

I woudl like to learn jQuery library. I don't know very well javascript,
dom, css.


I *strongly* recommend to first learn Javascript, the DOM and CSS.

Of the many drawbacks that jQuery has, consider this one. jQuery tries
to turn the syntax of Javascript into something else to the point where
you are no longer learning (or writing) Javascript, but rather, jQuery.

When you try to do something outside of jQuery's structure, you *still*
have to learn proper browsing scripting.

Then add in that jQuery is bug-riddled, fragile, error-prone and only
works in a subset of User-Agents ...
 
D

David Mark

It is a nice irony that when I load that page in IE6 it pops up no
less than 6 script error reports as the page loads (obviously I have
IE set up so it does pop-up script error reports). Amazon use JQuery
so a stream of script errors as the page loads is what would be
expected.

LOL. Lots of CSS warnings in FF as well. Looks like Amazon's team is
a real world beater. Unfortunately, this sort of incompetence is
infectious (good enough for Amazon!)
 
K

Kenny

David said:
LOL. Lots of CSS warnings in FF as well. Looks like Amazon's team is
a real world beater. Unfortunately, this sort of incompetence is
infectious (good enough for Amazon!)

I did a googlefight on John Resig+javascript and David Mark+javascript
and I can assure you there is no justice. Suggest you come in from the
cold and join qooxdoo while it is still nascent, ride the wave to the
top and glory and riches or whatever.

:)

kt
 
R

RobG

It is a nice irony that when I load that page in IE6 it pops up no
less than 6 script error reports as the page loads (obviously I have
IE set up so it does pop-up script error reports). Amazon use JQuery
so a stream of script errors as the page loads is what would be
expected.

It's even more ironic that one of the reasons touted for using jQuery
is that you can do more with less. One error reports as being on line
10,539, I'd hate to see the "more" version.
 
D

David Mark

It's even more ironic that one of the reasons touted for using jQuery
is that you can do more with less.  One error reports as being on line
10,539, I'd hate to see the "more" version.

How do you turn a legible 100 line script into a completely illegible
50 lines? Just add 50K of John Resig's delusions and voila! It just
works. It's concise, fast, etc.

No way these cults will last. There's a tipping point ahead.
 
K

Kenny

David said:
What a stupid idea.

You would be surprised how much wisdom can be gleaned from such a dumb
mechanism.
What does that mean?

It means you should maximize the quality of your life by...er...if you
can't fight em... Resig came in at 177k and you came in at 10k, OK?, and
from what I saw of search results all you ever do is post to mailing
lists: your web page (it's a page, not a site--google "Burton
snowboards" if you want to see where the bar is set on "site") did not
come up.

Helllooooo SEO!

You can huddle in here with your sycophants and be king of this
miserable little molehill of an NG where already you can go no higher
(have I made that sound appropiately sucky?) or grab a copy of qooxdoo
(or maybe dojo or, better, both) and start sending in contribs to wean
them of browser sniffing and whatever else you have to offer and quickly
get acknowledged as a master, hell, maybe make some $$$.

You know your stuff, you just need a suitable arena in which to display
it. This NG and various lists is not that arena.

qooxdoo kicked my ass over the last twenty-fours because of some
cockamamie dynamic pathing scheme they have and god knows what I broke
but I finally figured out I should give up on development mode and go
with build mode and get on with my life. Turns out it is a few extra
keystrokes every twenty minutes. And withal that I still had time to get
the web app up for the client and they are delighted with everything,
especially speed. Type in a fancy search, find 30k items, show the first
15: 1-2 seconds. scroll thru the rest of the results almost as fast as
if I am not on the interweb. wow.

no, the wheels are not coming off these frameworks as you predicted
elsewhere, because the upside they offer is worth their downside. Think
Windows 3.0 or Vista for that matter. As bad as the stuff sucks people
will shrug it off because they want what it gives. They will curse it
and hire developers to compensate for it but they will not give up on
it, and with IBM and Yahoo and Google pouring money into these
frameworks... what do you think is going to happen?

my2,kzo
 
N

Noway

Henry said:
It is a nice irony that when I load that page in IE6 it pops up no
less than 6 script error reports as the page loads (obviously I have

Indeed :)
IE set up so it does pop-up script error reports). Amazon use JQuery
so a stream of script errors as the page loads is what would be
expected.

Yes, but on the other hand you don't need a framework to write a crap,
furthermore it's easier to make mistake when programing low level part
of application (assembly/C) then in high level (perl/ruby).
 
D

David Mark

Indeed :)


Yes, but on the other hand you don't need a framework to write a crap,
furthermore it's easier to make mistake when programing low level part
of application (assembly/C) then in high level (perl/ruby).

That is a ridiculous comparison and jQuery has lots of built-in
mistakes that the developers don't understand (or are too ignorant to
care about.) Get it through your head that it is 50K of terrible
script. It is not a language.

If you picked out just the features of jQuery that make sense for your
average application, they will add up to something less than 50K. If
you know the language, it doesn't take long to write a script of that
size. People throw the game away from the outset because they fumble
around with scripting for a while, trying to wade through all of the
misinformation on the Web and subsequently conclude it is impossible.
Then they latch onto some other lost souls who "used to hate
Javascript" until they discovered this magical 50K script that makes
it fast, concise, etc.
 
N

Noway

David said:
That is a ridiculous comparison

In a contrary, it is very good comparison as higher languages take you
away from platform so you should be less aware of the platform your
application is running on.
and jQuery has lots of built-in
mistakes that the developers don't understand (or are too ignorant to
care about.) Get it through your head that it is 50K of terrible
script. It is not a language.

Of course it isn't a language, languages are only in my analogy.
Btw, I'm curious what's your opinion about prototype/mootools/dojo?
If you picked out just the features of jQuery that make sense for your
average application, they will add up to something less than 50K. If

Ok, and...?
you know the language, it doesn't take long to write a script of that
size. People throw the game away from the outset because they fumble
around with scripting for a while, trying to wade through all of the
misinformation on the Web and subsequently conclude it is impossible.

Matter of taste, if you ask me.
Then they latch onto some other lost souls who "used to hate
Javascript" until they discovered this magical 50K script that makes
it fast, concise, etc.

What is wrong with "fast" and "concise"?
 
D

David Mark

In a contrary, it is very good comparison as higher languages take you
away from platform so you should be less aware of the platform your
application is running on.

But it is not a language. It is a script written in Javascript. Not
a particularly good one and not particularly long either.
and jQuery has lots of built-in


Of course it isn't a language, languages are only in my analogy.

It's the same stupid analogy that is repeated constantly by proponents
of these libraries. It misses the point completely. If browser
scripting is to assembler, what jQuery is to a bad program written in
assembly language. In other words, jQuery is 50K of junk code, not a
C compiler.
Btw, I'm curious what's your opinion about prototype/mootools/dojo?

Prototype is a complete crock as well. Always has been. What can you
say about a Javascript program that adds lots of bloat to "work
around" prototypal inheritance, yet is named "Prototype." That's the
mindset. And it is full of browser sniffing, which the developers
must constantly twiddle with to make it "work" in a handful of
browsers in their default configurations.

Mootools is the same stupid thing as far as inheritance. Last I
checked, it is also sniffs the user agent string (an automatic F.)
And IIRC, their documentation states (or stated at one point) that
most of the methods require an "XHTML doctype" (they meant they don't
support quirks mode.) That pretty much sums them up.

Never used Dojo or paid much attention to it. It is a huge framework,
so it should be a non-entity on the Web. I'm sure lots of hacks are
using it behind corporate firewalls. They'll regret it eventually,
but at least they won't foul up the Web in the process.

The "jQuery vs. Prototype" arguments are but noise from two camps of
myopic and ignorant fanatics. Here is a snippet from one of them I
recently noticed at the bottom of a blog entry:

"hello there, i am learning for a bit more than a year… I am a noob
actually and crazy me to write here. Anyway since 3 months i have to
work on both libraries, Prototype (+scriptaculous) on a side and
Jquery on an other. I have to admit i started by learning Prototype.
Few weeks ago, i was blaming jquery cuz i had hard time to make my
stuff working. i was so pissed, i started arguing with my colleagues,
explaining them that it wasnt the right choice and Prototype was the
best."

That's the mindset, though it is often expressed in a more eloquent
fashion. Except these days it is "MooTools vs. jQuery." Just tune
them out.
Ok, and...?

....did you keep reading?
Matter of taste, if you ask me.

How is programming for failure at the outset a matter of taste? It is
a matter of necessity for those with no experience or ability, but who
would want such people writing, testing and maintaining scripts? It's
ridiculous.
What is wrong with "fast" and "concise"?

Nothing. But it is ironic that a library that promotes terribly
inefficient code patterns would be referred to as "fast." And concise
for jQuery means illegible + 50K. But, of course, if you have never
known anything but jQuery, you are unlikely to recognize this.
 
T

The Natural Philosopher

Noway said:
Indeed :)


Yes, but on the other hand you don't need a framework to write a crap,
furthermore it's easier to make mistake when programing low level part
of application (assembly/C) then in high level (perl/ruby).

I would aver that the level you write at merely changes the SORT of bugs
you generate, not thir frequency. ;0-)
 
D

David Mark

Prototype is a complete crock as well.  Always has been. [...]
And it is full of browser sniffing, which the developers
must constantly twiddle with to make it "work" in a handful of
browsers in their default configurations.

Apparently, that's about to change:http://ajaxian.com/archives/common-feature-tests

I must have missed Sixty Minutes.

Here is the script by "Kangax" that is featured in the article. It
has nothing to do with Prototype. In fact, at least part of it is
lifted directly from my library.

(function(){

var t = new Date();

function isHostMethod(o, m) {
var t = typeof(o[m]);
return t == 'function' || !!(t == 'object' && o[m]) || t ==
'unknown';
};


Now, where have I seen that before? Oh yeah, I wrote and published it
here a year ago (and it is now part of my library.)


var features = { };
var bugs = { };

features.IS_TRANSFORMATION_SUPPORTED =
(features.__IS_TRANSFORMATION_SUPPORTED = function(){
var el = document.createElement('div');


Oops. Where's the test for document.createElement?


var isSupported = ('WebkitTransform' in el.style) ||
('MozTransform' in el.style);


How very interesting. Using the - in - operator to smooth over
differences in older browsers is obviously not a good idea. He forgot
to copy isRealObjectProperty.


el = null;
return isSupported;
})();

features.IS_TAGNAME_UPPERCASED = (features.__IS_TAGNAME_UPPERCASED =
function(){
return /[A-Z]/.test(document.documentElement.tagName);
})();


What a perfectly ridiculous test. And it assumes
document.documentElement exists.


bugs.QUERY_SELECTOR_IGNORES_CAPITALIZED_VALUES =
(bugs.__QUERY_SELECTOR_IGNORES_CAPITALIZED_VALUES = function(){
var el = document.createElement('div'),
el2 = document.createElement('span'),
isBuggy = false;
el2.className = 'Test';
el.appendChild(el2);
isBuggy = ('querySelector' in el) ? (el.querySelector('.Test') !==
null) : null;
el = el2 = null;
return isBuggy;
})();


Same issues. And what possible use is this?


features.ARRAY_PROTOTYPE_SLICE_CAN_CONVERT_NODELIST_TO_ARRAY =
(features.__ARRAY_PROTOTYPE_SLICE_CAN_CONVERT_NODELIST_TO_ARRAY =
function(){
try {
return (Array.prototype.slice.call(document.forms, 0) instanceof
Array);


Kore bad assumptions.


} catch(e) { };
return false;
})();


A try-catch clause in a gateway? That's rich.


features.EVENT_HANDLERS_ARE_FIFO =
(features.__EVENT_HANDLERS_ARE_FIFO = function(){
function addEvent(element, name, handler) {
if (element.addEventListener) {


Why did he bother to steal isHostMethod?


element.addEventListener(name, handler, false);
}
else if (element.attachEvent) {
element.attachEvent("on" + name, handler);
}
}
function removeEvent(element, name, handler) {
if (element.removeEventListener) {
element.removeEventListener(name, handler, false);
}
else if (element.detachEvent) {
element.detachEvent("on" + name, handler);
}
}
function handler1() {
a.push(1);
}
function handler2() {
a.push(2);
}
var f = document.createElement('form'), a = [];
f.action = '';
addEvent(f, 'reset', handler1);
addEvent(f, 'reset', handler2);
f.reset();
removeEvent(f, 'reset', handler1);
removeEvent(f, 'reset', handler2);
f = null;
return (a[0] === 1);
})();


Another useless waste of time.


features.WINDOW_EVAL_EVALUATES_IN_GLOBAL_SCOPE =
(features.__WINDOW_EVAL_EVALUATES_IN_GLOBAL_SCOPE = function(){
var fnId = '__eval' + Number(new Date()),
passed = false;

window.eval('function ' + fnId + '(){}');
passed = (fnId in window);
if (passed) {
delete window[fnId];
}
return passed;
})();


More worthless than the last.


(function(){

features.IS_EVENT_METAKEY_PRESENT = false;
features.IS_DOM2_EVENT_INTERFACE_IMPLEMENTED = false;
features.IS_EVENT_SRCELEMENT_PRESENT = false;

var i = document.createElement('input'),
root = document.documentElement;
if (i) {
i.type = 'checkbox';
i.style.display = 'none';
i.onclick = function(e) {
e = e || window.event;
features.IS_EVENT_METAKEY_PRESENT = ('metaKey' in e);
features.IS_DOM2_EVENT_INTERFACE_IMPLEMENTED =
(('preventDefault' in e) && ('stopPropagation' in e));
features.IS_EVENT_SRCELEMENT_PRESENT = ('srcElement' in e);
};
root.appendChild(i);
i.click();

OMFG. People with no experience or ability fit right in with the
Prototype crowd. As mentioned, he is now part of the "core." It's
over. No amount of feature testing (even if competent) can save it.

[snip additional useless nonsense]

Here is a typical response from a library jockey (found at the bottom
of the page.)

"It seems to me that the popularity of the libraries themselves have
already guaranteed that browser sniffing will work.
..
Take Chrome. It worked pretty well right out of the gate because they
tested it against a myriad of web sites. Who is going to release a
browser that crashes on jQuery sites, for example?"

Chrome is misidentified by jQuery as Safari (that will catch up to
them.) And browser developers do not bend to browser sniffers (they
break them.)
 
D

David Mark

You would be surprised how much wisdom can be gleaned from such a dumb
mechanism.





It means you should maximize the quality of your life by...er...if you

Can't make heads or tails of that.
can't fight em... Resig came in at 177k and you came in at 10k, OK?, and

And what does that mean? He has spent the last few years self-
promoting as a "JavaScript Evangelist" (or Ninja or Rock Star or
whatever.) I have not and see no real benefit in doing so.
from what I saw of search results all you ever do is post to mailing
lists: your web page (it's a page, not a site--google "Burton

I never post to mailing lists.
snowboards" if you want to see where the bar is set on "site") did not
come up.

No, I don't have a vanity site. I neither want nor need one.
Helllooooo SEO!

Hellooooooo Mr. Wilson! Whatever. The "page" you speak of is not
about me. However, if you try "browser scripting" and "library", you
will find it is #1 on Yahoo and #3 on Google.
You can huddle in here with your sycophants and be king of this
miserable little molehill of an NG where already you can go no higher

Molehill? Google seems to think otherwise.
(have I made that sound appropiately sucky?) or grab a copy of qooxdoo
(or maybe dojo or, better, both) and start sending in contribs to wean
them of browser sniffing and whatever else you have to offer and quickly
get acknowledged as a master, hell, maybe make some $$$.

LOL. I'd venture I have made more $$$ in the last year than you will
see in the next decade using Qx00d00 (sp?)
You know your stuff, you just need a suitable arena in which to display
it. This NG and various lists is not that arena.

Again, what lists? And never you mind where I display anything.

[snip]
 
D

David Mark

lists: your web page (it's a page, not a site--google "Burton
snowboards" if you want to see where the bar is set on "site") did not
come up.

Helllooooo SEO!

[snip]

Oddly enough, "David Mark" and "Javascript" does bring up the My
Library *site* (or application if you prefer.) If is around #12 on
Yahoo. Stranger still, no mailing list posts at all.

[snip]
 
D

David Mark

[snip]
lists: your web page (it's a page, not a site--google "Burton
snowboards" if you want to see where the bar is set on "site")

Great site, shithead.

http://www.cinsoft.net/images/burtonsucks.jpg

It is based on Flex apparently. Here's an excerpt:

<!--[if gte IE 7]>
<style type="text/css" media="screen">
#flashCell { width:expression(((document.compatMode &&
document.compatMode=='CSS1Compat') ?
document.documentElement.clientWidth : document.body.clientWidth) <
962 ? "960px" : "100%"); }
#flashCell { height:expression(((document.compatMode &&
document.compatMode=='CSS1Compat') ?
document.documentElement.clientHeight : document.body.clientHeight) <
629 ? "627px" : "100%"); }

#productsearch .query { margin-top: -1px; }
/* <![CDATA[ */ @import url(/Include/CSS/ie7.css); /* ]]> */</
style><![endif]-->

Children shouldn't play with Web things.

[snip]
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top