Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

jslint_com · This group has moved to Google Plus.

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 584
  • Category: JavaScript
  • Founded: Mar 7, 2008
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
JSLint and DOM constructor types.   Topic List   < Prev Topic  |  Next Topic >
Summarize Messages Sort by Date  
#773 From: "pauanyu" <pcxunlimited@...>
Date: Mon Aug 3, 2009 12:43 pm
Subject: JSLint and DOM constructor types.
pauanyu
Send Email Send Email
 
JSLint doesn't like DOM types:

Element
NodeList
etc.

So you can't do (foo instanceof Element) to see if it's a HTMLElement, or (foo
instanceof NodeList) to see if it's a NodeList.

Currently I make it work by putting a /*global */ statement at the top of my
programs:

/*global Element, NodeList */

Using "var Element, NodeList;" causes errors, so I -must- use the /*global */
construct.

Any chance of JSLint becoming aware of the DOM types?




#774 From: "Douglas Crockford" <douglas@...>
Date: Mon Aug 3, 2009 3:01 pm
Subject: Re: JSLint and DOM constructor types.
douglascrock...
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, "pauanyu" <pcxunlimited@...> wrote:
>
> JSLint doesn't like DOM types:
>
> Element
> NodeList
> etc.
>
> So you can't do (foo instanceof Element) to see if it's a HTMLElement, or (foo
instanceof NodeList) to see if it's a NodeList.
>
> Currently I make it work by putting a /*global */ statement at the top of my
programs:
>
> /*global Element, NodeList */
>
> Using "var Element, NodeList;" causes errors, so I -must- use the /*global */
construct.
>
> Any chance of JSLint becoming aware of the DOM types?

I will add them when IE adds them. Currently, I think it is more helpful for
JSLint to report that NodeList is not available on 80% of browsers.




#775 From: "pauanyu" <pcxunlimited@...>
Date: Mon Aug 3, 2009 10:26 pm
Subject: Re: JSLint and DOM constructor types.
pauanyu
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
>
> I will add them when IE adds them. Currently, I think it is more helpful for
JSLint to report that NodeList is not available on 80% of browsers.
>
Understandable. Er, IE still holds 80% of the market share? If I recall,
basically every browser other than IE supports NodeList, and that IE has closer
to 68% market share (along with all the disclaimers about how unreliable market
share tests are).




#781 From: "pauanyu" <pcxunlimited@...>
Date: Thu Aug 6, 2009 12:47 am
Subject: Re: JSLint and DOM constructor types.
pauanyu
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
>
> I will add them when IE adds them. Currently, I think it is more helpful for
JSLint to report that NodeList is not available on 80% of browsers.
>

By the way, I ran some tests in IE8. Apparently IE8 *does* support Element, but
not NodeList:


var body = document.getElementsByTagName("body");
console.log("Element: " + (body[0] instanceof Element)); // true
console.log("NodeList: " + (body instanceof NodeList)); // false


I have no clue whether IE7 or IE6 support Element, however.




 
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help