26 points · by yottafala · 16y ago · 11 comments
I agree - not entirely sure how this climbed up so high on the front page. There are far better resources available, including the jQuery documentation itself, or http://net.tutsplus.com/tutorials/javascript-ajax/jquery-1-4...
eg
if(element.childNodes.length==0)I think someone is trying to game the system here.
$('#id').replaceWith('<div>I have been replaced</div>');
I prefer
$('#id').replaceWith($('<div/>').text('I have been replaced.'));
if($([selector]).is(":empty")) { // do stuff }
http://www.amazon.com/jQuery-Cookbook-Solutions-Examples-Dev...