New answers tagged

1

Louys has already mentioned a couple great techniques. There are a few others: Use the shortcut method $.get() passing the URL as the first parameter and the success callback as the second parameter Do elements with the class "delCommentLink" get added to the page after the page is loaded or do they all exist when the page is loaded? If the latter ...


3

Main Question Is there better logic? Repeated code The first thing that I see with this code, which perhaps you see also, is that it is quite repetitive - select a list of checkboxes to see if any are checked - if none are checked then show an error message and return, otherwise hide any affiliated error message. This violates the Don't Repeat Yourself ...


1

The function addRemoveHideClass() uses to calls to the array method filter(). That method "creates a new array with all elements that pass the test implemented by the provided function." 1 That method is meant to filter an array of elements that match a certain criteria so it returns an array 2. If you just want to iterate over the elements in the ...


Top 50 recent answers are included