21 votes
Accepted

Don't search for minors, it isn't allowed

This part of the review is focused on the Javascript aspect of the answer I will be really light on this review. I will try to make it short and quick. You have some mixed quotes. Consider the ...
11 votes
Accepted

Custom JavaScript validation using the factory / module patterns

This review is mostly about improving the implementation. I don't know JavaScript enough to answer your big questions. Try to catch @konijn or @flambino in the 2nd monitor chat room. Naming The ...
  • 109k
7 votes

Custom JavaScript validation using the factory / module patterns

(The following is about the HTML only.) Identation The identation of your markup is all over the place. I suggest identing by atleast two spaces. I prefer four spaces, though. I’ll append a fixed ...
  • 3,659
6 votes

Simple jQuery drag event

The semicolons after the closing braces are really unnecessary, and the indentation is a bit off here: ...
  • 109k
6 votes
Accepted

jQuery dialog for help popup

I would suggest loading the external file and initializing the dialog prior to the event...kind of like: ...
  • 306
5 votes
Accepted

JavaScript form validation

Formatting First of all with the excessive whitespace at the beginning of lines, and the indenting that seems to follow no logic, this is extremely difficult to read. For example, this would be so ...
  • 109k
5 votes
Accepted

Retirement Calculator

Since you're using some ES6+ features, I'd definitely recommend looking into others, such as let, arrow functions, and so on. This website is a good start, and you ...
  • 166
4 votes
Accepted

Toggle-item inside a Bootstrap dropdown-menu

It'd definitely be nice to get rid of the inlined style attributes. Since you've already ID'ed the sub-menu pretty extensively, it's pretty easy to add this to the ...
  • 32.9k
4 votes
Accepted

Empty an array on focusout - jQuery UI Autocomplete

I believe this is a case of being too paranoid in optimization. Here's some problems: Your arr is global. You should probably place this somewhere only the widget ...
  • 24.8k
4 votes
Accepted

jQuery Accordion + Sub Accordion + Search Filter

Well, there is a room for improvement in a few areas, Save references to the elements rather than using them like $("#element_id") every time you need them to ...
4 votes
Accepted

Toggle functions for drop down for a clock time widget

There a few simple things you could do to help clean up this code. The first thing I always recommend is to create a closure for your script using an IIFE. This allows your code to run in its own ...
  • 1,066
4 votes
Accepted

Make To and From date range picker using jQuery UI

Instead of destroying and recreating the datepickers, use the (3rd) option method (e.g. .option('maxDate', selectedDate)) to set the minDate/maxDate options when ...
3 votes
Accepted

Autocomplete selector country/region/city for ex-USSR countries

There is too much nesting, which, for me, makes the logic hard to read. A good rule of thumb is to aim for two levels of nesting, by using the Extract Method refactoring. When the user clicks on the ...
  • 321
3 votes
Accepted

jQuery slider in a Python/Django SessionWizardView

If you need to externalise/compact the $(".someslider").slider() function, I would do it like this: External script 'sliders_setup.js', depending on jQuery: ...
  • 251
3 votes
Accepted

jQuery plugin - image slider

Overall, I would say the code is well written. I can't speak about the jQueryUI parts because I am not as familiar with it. However, there are a couple of things you can do to improve it though. ...
  • 1,066
3 votes
Accepted

Create multiple parametherized JQueryUI dialog boxes

Question responses What would be your method to improve the management of multiple functions? Looking at the three functions that call dialog_Handler() it ...
2 votes

Using jQuery UI .position() in a backwards compatible way

Interesting question, have you tried passing +0 as an offset, that should work and make your code a little easier to read. ...
  • 32.7k
2 votes
Accepted

Autocomplete search or instant search script for shopify

Don't put a comment before each variable at the top. I'd recommend separating them into related groups, and describing each of the variables in those groups in a comment at the top of each group. Why ...
2 votes
Accepted

Meteor jquery-ui slider integration

I think you can avoid the Tracker.autorun completely by updating the value in a template helper -- this is possible because your data is coming from a Collection, so it's already reactive. You can ...
2 votes
Accepted

Dynamically change data in Chart.js charts with jQuery slider

So, your stack is storing three different types of things: dates, totalBudgets, and ...
2 votes

Autocomplete selector country/region/city for ex-USSR countries

dcorking has good points in his/her answer - especially about the redundant code (i.e. point #3). Below is my suggestion to improve the code, in addition to his/her advice. Cache DOM Lookups Like I ...
2 votes

JavaScript form validation

There is a lot of repetitive code. For each field, the jQuery selector, the test, and the error message vary. However, the code to trigger the check, change the colors, set the focus, and note the ...
2 votes
Accepted

Populate a table from a database using JavaScript from a jQuery UI Dialog Box

Only targeting the C# code behind BuildDivContent() Instead of calling two times if (results.Any()) for appending " you ...
  • 50k
2 votes

jQuery Accordion + Sub Accordion + Search Filter

It seems like there is a defect with how the terms are searched. When you use a word that shows up in an answer and not the question, the answer is replaced in each subsequent answers. For example, ...
  • 21
2 votes

Retirement Calculator

Parsing integers The function convert() calls parseInt() with no second parameter (i.e. radix). The MDN documentation states ...
1 vote
Accepted

Toggle the visibility of sections of a form

As said by konijn in his answer, hasClass -> add/remove class can be replaced by toggleClass(). ...
  • 2,956
1 vote

Toggle the visibility of sections of a form

A mini review on this part of the code: ...
  • 32.7k
1 vote
Accepted

Display tabular data with jQuery Datatables plugin

A few thoughts on the client-side code : Fixes the save handler appears not to do any saving. $.ajax() dataType option is ...
  • 1,289
1 vote

jQuery resizable plugin

Your code is good, but there's a few things you can improve on: ...
  • 11.9k
1 vote
Accepted

Summing 3 jQuery modal dialog functions

There are a couple of things that can be improved Don't Repeat Yourself: you can condense all three dialog initialisers in a single call; same for all three click-opens Be consistent: don't mix ...
  • 159

Only top scored, non community-wiki answers of a minimum length are eligible