Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > jQuery takes down the Guardian

Reply
Thread Tools

jQuery takes down the Guardian

 
 
David Mark
Guest
Posts: n/a
 
      11-03-2011
Nah, those fabled attr issues don't cause problems in the "real
world".

http://www.guardian.co.uk/info/devel...mment-platform

I'm so jealous of those (soon to be) unemployed developers.
 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      11-03-2011
On Nov 4, 5:52*am, David Mark <(E-Mail Removed)> wrote:
> Nah, those fabled attr issues don't cause problems in the "real
> world".
>
> http://www.guardian.co.uk/info/devel...03/javascript-...
>
> I'm so jealous of those (soon to be) unemployed developers.


The article itself seems somewhat clueless. The markup examples use
XHTML, yet The Guardian web site uses <!DOCTYPE html>[1].

They seem to be under the illusion that javascript changes the markup.

There is also:

| In jQuery 1.6, this method now returns "undefined",
| which Javascript gurus will know is not the same
| as false (unless you use === comparison).

Really?

Anyhow, a design "feature" to wait for the user to start typing before
enabling the submit button is plain dumb.

But kudos for being honest.


1. http://www.guardian.co.uk/


--
Rob

 
Reply With Quote
 
 
 
 
Matt McDonald
Guest
Posts: n/a
 
      11-03-2011
On 11-11-03 2:56 PM, RobG wrote:
> They seem to be under the illusion that javascript changes the markup.


No, merely the illusion that setting a boolean attribute *value* to an
empty string removes it (it doesn't). It still yields a DOM property of
*true*, which clearly baffled them. Blame the software, not the
implementer, right? *dunce*

Coincidentally, jQuery 1.7 hit the internet today. They sure have
impeccable timing.

 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      11-03-2011
Matt McDonald wrote:

> On 11-11-03 2:56 PM, RobG wrote:
>> They seem to be under the illusion that javascript changes the markup.

>
> No, merely the illusion that setting a boolean attribute *value* to an
> empty string removes it (it doesn't). It still yields a DOM property of
> *true*, which clearly baffled them. Blame the software, not the
> implementer, right? *dunce*


They are completely delusional as they actually believe in "Javascript
upgrade" (sic!) (when they mean jQuery upgrade instead). After reading its
title I already knew I did not have to waste more time on that article.

> Coincidentally, jQuery 1.7 hit the internet today. They sure have
> impeccable timing.


ACK


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
 
Reply With Quote
 
RobG
Guest
Posts: n/a
 
      11-03-2011
On Nov 4, 7:47 am, Matt McDonald <(E-Mail Removed)> wrote:
> On 11-11-03 2:56 PM, RobG wrote:
>
> > They seem to be under the illusion that javascript changes the markup.

>
> No, merely the illusion that setting a boolean attribute *value* to an
> empty string removes it (it doesn't).


I have no idea what the attr method actually does in either version of
jQuery in this case, so I don't know what the actual effect on the DOM
is.

However, the HTML disabled attribute doesn't have a value at all, its
presence or absence changes the value of the related boolean DOM
property (something that is maintained in HTML5[1]), which is what the
document claimed to be). Attempting to explain the effect of jQuery's
attr using XHTML markup for an HTML document is an indicator that they
still don't know what is going on.

Interestingly, if they'd actually the latest HTML5 draft, they'd have
seen that this exact case is pointed out in section 1.9.3 under
"Errors that indicate a likely misunderstanding of the
specification"[2]:

| For example, setting the disabled attribute to the value
| "false" is disallowed, because despite the appearance of
| meaning that the element is enabled, it in fact means that
| the element is disabled (what matters for implementations
| is the presence of the attribute, not its value).

The authors of HTML5 seem to delight in confusion since they
constantly refer to "attributes" in the context of both HTML
attributes and DOM properties.


> It still yields a DOM property of
> *true*, which clearly baffled them.


It may set the related DOM "disabled" property to true.

> Blame the software, not the
> implementer, right? *dunce*


Clearly they had no idea what the method actually does, and even if
they did, they don't seem to understand HTML DOMs anyway.


> Coincidentally, jQuery 1.7 hit the internet today. They sure have
> impeccable timing.


I guess it will roll out in their regular second Tuesday update.


1. http://dev.w3.org/html5/spec/Overvie...tr-fe-disabled
2. http://dev.w3.org/html5/spec/Overvie...tribute-values

--
Rob
 
Reply With Quote
 
J.R.
Guest
Posts: n/a
 
      11-04-2011
On 03/11/2011 18:56, RobG wrote:
> On Nov 4, 5:52 am, David Mark<(E-Mail Removed)> wrote:
>> Nah, those fabled attr issues don't cause problems in the "real
>> world".
>>
>> http://www.guardian.co.uk/info/devel...03/javascript-...
>>
>> I'm so jealous of those (soon to be) unemployed developers.

>
> The article itself seems somewhat clueless. The markup examples use
> XHTML, yet The Guardian web site uses<!DOCTYPE html>[1].
>
> They seem to be under the illusion that javascript changes the markup.
>
> There is also:
>
> | In jQuery 1.6, this method now returns "undefined",
> | which Javascript gurus will know is not the same
> | as false (unless you use === comparison).
>
> Really?
>
> Anyhow, a design "feature" to wait for the user to start typing before
> enabling the submit button is plain dumb.
>
> But kudos for being honest.
>
>
> 1. http://www.guardian.co.uk/
>


The page 3 site of "The Sun" uses JQuery too, but it seems that no one
cares about it...

Cheers,
JR
 
Reply With Quote
 
Matt McDonald
Guest
Posts: n/a
 
      11-04-2011
On 11/3/2011 5:30 PM, RobG wrote:
> However, the HTML disabled attribute doesn't have a value at all, its
> presence or absence changes the value of the related boolean DOM
> property (something that is maintained in HTML5[1]), which is what the
> document claimed to be).


It all depends on the doctype, really.
HTML 4.01[0] and HTML 5[1] validate both the minimized and maximized
forms, so (psuedocode):

* boolean
* boolean=""
* boolean="boolean"

XHTML 1.0 only validates the maximized form[2], so (pseudocode):

* boolean="boolean"

> The authors of HTML5 seem to delight in confusion since they
> constantly refer to "attributes" in the context of both HTML
> attributes and DOM properties.


Yes, the usage of "IDL attribute" as an alias for "DOM property" is
quite confusing upon first glance. It seems it's because "idl" is the
filetype in which these properties are defined as "attributes". Here's a
look at one:

http://www.w3.org/TR/DOM-Level-2-HTML/idl/html2.idl

Clear as mud, right?

> It may set the related DOM "disabled" property to true.


Ha, good catch. I was in a hurry this afternoon, so forgive the lack of
elaboration.

Not to be a stickler, but I'd suggest linking to the HTML 5 spec via the
multipaged version[3]. The full spec is a real hog.

[0]: http://www.w3.org/TR/html401/intro/s...html#h-3.3.4.2
[1]:
http://dev.w3.org/html5/spec/common-...ean-attributes
[2]: http://www.w3.org/TR/xhtml1/#h-4.5
[3]: http://dev.w3.org/html5/spec/spec.html

--
Matt McDonald: Web/Flash Developer; Edmonton, Alberta, Canada
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      11-04-2011
Matt McDonald wrote:

> On 11/3/2011 5:30 PM, RobG wrote:
>> However, the HTML disabled attribute doesn't have a value at all, its
>> presence or absence changes the value of the related boolean DOM
>> property (something that is maintained in HTML5[1]), which is what the
>> document claimed to be).

>
> It all depends on the doctype, really.
> HTML 4.01[0] and HTML 5[1] validate both the minimized and maximized
> forms, so (psuedocode):
>
> * boolean
> * boolean=""
> * boolean="boolean"
>
> XHTML 1.0


XHTML in general.

> only validates the maximized form[2], so (pseudocode):
>
> * boolean="boolean"


The statement "$markup_language validates only …" does not make sense. A
*validator* validates code supposedly written in $markup_language against
the formal specification of $markup_language. Therefore, a proper
expression would be "… is valid in $markup_language" or "$markup_language
requires …".

>> The authors of HTML5 seem to delight in confusion since they
>> constantly refer to "attributes" in the context of both HTML
>> attributes and DOM properties.

>
> Yes, the usage of "IDL attribute" as an alias for "DOM property" is
> quite confusing upon first glance. It seems it's because "idl" is the
> filetype in which these properties are defined as "attributes".


No, the Object Management Group (OMG) Interface Definition Language (IDL), a
C++-like interface description language which has been developed for CORBA,
is the preferred form of specifying language-independent (W3C) DOM
interfaces. The filename suffix (which you misname "filetype") is only
evidence of that.

> Here's a look at one:
>
> http://www.w3.org/TR/DOM-Level-2-HTML/idl/html2.idl
>
> Clear as mud, right?


It is very clear. Problems arise when one fails to differentiate between
language-independent IDL attributes, properties that implement them in a
specific programming language, and markup attributes of a specific related
SGML-rooted markup language like HTML or XHTML.


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      11-04-2011
On Nov 3, 9:50*pm, Andrew Poulos <(E-Mail Removed)> wrote:
> On 4/11/2011 6:52 AM, David Mark wrote:
>
> > Nah, those fabled attr issues don't cause problems in the "real
> > world".

>
> >http://www.guardian.co.uk/info/devel...03/javascript-...

>
> The issue would be no different to a lead developer changing a feature
> of some custom js code a project ran on and failed to document it
> properly, or that those underneath her didn't understand js well enough.


Sort of. The problem is that Web developers abdicate responsibility to
"lead developers" that they don't know. Their only documentation is
the jQuery documentation, which is rubbish. For years, the "attr"
function has been documented to get/set attributes, but it never did
that at all (except when it "detected" an XML DOM). The well-
documented boondoggle with jQuery 1.6 was the result of changing the
method to match the name/documentation (and never mind that it broke
thousands of extant apps). Then they put it back the way it used to be
on the next release. They are just going around in circles.

>
> To be fair, even though they don't understand the issues they were able
> to fix it pretty quickly (in that they were able to get their site
> working "properly"). The next time they'll just test first before they
> deploy.


What they did is the standard mystical incantation: rearranging
patterns of code until they seem to work. Ultimately, they settled on
using the "removeAttr" method, which was the centerpiece of my last
jQuery review. For those who missed it, that method is confused
nonsense as well (and changes periodically as their "test-driven"
knowledge gathering reveals more cracks in their assumptions). If only
they would RTFM, they wouldn't be causing so much confusion among
beginners who rely on their "expertise" to keep them out of trouble.
 
Reply With Quote
 
Eric Bednarz
Guest
Posts: n/a
 
      11-04-2011
Matt McDonald <(E-Mail Removed)> writes:

> HTML 4.01[0] and HTML 5[1] validate both the minimized and maximized
> forms, so (psuedocode):
>
> * boolean
> * boolean=""


That is obviously *not* valid in HTML 4. You can omit the attribute
name, not the value.

> * boolean="boolean"


--
λ
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft expanding it use of jQuery & involvement with jQuery lorlarz Javascript 6 03-25-2010 10:14 PM
jQuery Query about comparing jQuery references Aaron Gray Javascript 20 07-27-2008 01:53 PM
Review: NZXT Guardian Case Review Silverstrand Reviews & How-To's 0 06-20-2005 02:56 AM
Guardian Backpacks - First Crime-Fighting Backpack Designed to Save Lives posh Computer Support 2 06-07-2005 04:58 PM
Guardian: Oftel assigns new UK telephone prefix to VoIP Sufaud VOIP 0 09-07-2004 10:45 AM



Advertisments