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 ...
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 ...
6
votes
Accepted
Movie tickets booking system (Frontend only)
UX (User Experience)
I'll start with a few possible improvements to the User Experience functionality.
In order to offer the best possible interface you have to provide the same or similar ...
6
votes
Simple jQuery drag event
The semicolons after the closing braces are really unnecessary, and the indentation is a bit off here:
...
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:
...
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 ...
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 ...
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 ...
4
votes
Accepted
Dialog multiple instantiations
Looks OK to me. jQueryUI will take care of most of the low-level stuff like not letting you open several dialogs and such (by simply not letting you click "behind" the modal).
The code could be ...
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 ...
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 ...
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 ...
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 ...
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 ...
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:
...
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. ...
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.
...
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
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 ...
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
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, ...
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().
...
1
vote
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
jquery-ui × 78javascript × 76
jquery × 66
html × 16
css × 7
beginner × 6
performance × 4
asp.net × 4
datetime × 3
html5 × 3
animation × 3
plugin × 3
user-interface × 3
audio × 3
autocomplete × 3
c# × 2
validation × 2
ajax × 2
data-visualization × 2
coffeescript × 2
python × 1
python-2.x × 1
json × 1
image × 1
error-handling × 1