News for hackers. Stuff that matters.
Re:You might not need jQuery by jpatte on Thursday January 30, 2014 @02:15PM (#7152728)
Abstractions are meant to, well, abstract an implementation. You might very well want to abstract a native operation for a bunch of different reasons. You don't need to, but maybe you should.

For example,

  $(el).hide()
is quite more readable than

  el.style.display = 'none'
. And I'm not even talking about the other advantages.
Re:You might not need jQuery by drdaeman on Thursday January 30, 2014 @09:43PM (#7154917)
> $(el).hide()

> el.style.display = 'none'

You meant something more like

    document.querySelectorAll(el).forEach(function(e) { e.style.display = 'none'; }
and a polyfill for IE8 due to lack of native Array#forEach, right?
Re:You might not need jQuery by kibibu on Thursday January 30, 2014 @10:03PM (#7154989)
This equivalency only works when el is a DOMElement, not a selector string.
Re:You might not need jQuery by talmand on Friday January 31, 2014 @11:04AM (#7157303)
Which one is likely to be more common?
Re:You might not need jQuery by daleharvey on Thursday January 30, 2014 @03:00PM (#7152983)
Its

   el.hidden = true;
in modern browsers
Re:You might not need jQuery by rwaldron on Thursday January 30, 2014 @05:58PM (#7153954)
The documented semantics of the hidden attribute say otherwise https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att... http://www.w3.org/html/wg/drafts/html/master/editing.html#th...

" it is incorrect to use hidden to hide panels in a tabbed dialog, because the tabbed interface is merely a kind of overflow presentation — one could equally well just show all the form controls in one big page with a scrollbar"

Re:You might not need jQuery by nostrademons on Thursday January 30, 2014 @03:40PM (#7153220)
I'm curious - is this spec'd anywhere? I just tried it in Chrome and it works great, but I couldn't find it in any of the specs for Element or Node.
Re:You might not need jQuery by talmand on Friday January 31, 2014 @11:11AM (#7157334)
According to specs mentioned elsewhere, it seems to have reasons to exist other than just display hide/show purposes.

It's easily overridden by CSS.

el.style.display = 'none' pretty much works everywhere.

To me, it seems to depend upon what the purpose of hiding/showing the element is in specific cases.