a JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.
1
vote
1answer
32 views
Popup jQuery plugin
I need a code review for my first jQuery plugin. It seems like a lot of code and I want to hear something about my plugin code structure and more.
...
2
votes
1answer
20 views
String building attribute selectors
I'm dynamically selecting elements in jQuery, how can I make it more resilient?
$('[data-example="' + exampleData + '"]').each(...);
I'm concerned that the data ...
3
votes
1answer
71 views
Simple jQuery photo slider
I'm fairly new to front end web development, but finally felt confident enough to create my own jQuery slider. I wish to receive constructive criticism about my code, how I can optimize any line of ...
0
votes
1answer
36 views
Vote-switching optimization
I have 2 <label>s being used for displaying the votes, which is up votes and down votes. There is no problem for the adding or removing votes, but the ...
4
votes
3answers
107 views
Changing color on button click
I have an html button that when the user clicks the button it will change color from blue to red and back. Is there a better way to do this in jQuery?
HTML/jQuery
...
1
vote
1answer
52 views
Loading details of a list of cars
I have a tree view with a list of cars and a webservice to get the details for each car.
On page load, there are no cars selected so the details footer is loaded with all cars.
...
-5
votes
0answers
29 views
4
votes
0answers
62 views
Colour-matching game
This is a game about matching the right colour. In the first level you start with 3 cubes that each have a different colour. After 2 seconds the colours of the cubes disappear and the cubes become ...
1
vote
0answers
18 views
Matching text is one set of <li> to another set of <li> using jQuery
I'm trying to match the text in one block of li tags against another block of li tags, and although this works, there must be a better way of doing it without nested loops.
...
1
vote
3answers
63 views
Toggling image sources
I have a set of images with class = tt like so:
<img src="images/arc_unselected.png" title="Arc" class="tt" />
and I ...
6
votes
1answer
143 views
Phishing application God class
This project is ultimately my senior thesis to graduate from college. It will end up being very long with several code reviews and redesigns. The next rubberduck perhaps?
I've been working on a ...
2
votes
2answers
40 views
Retrieve data from json file and avoid HTML/JS tight coupling
I am retrieving data from a json object and even though code works I am not sure if I am following best practices.
In particular some of the objects seems too deep (like value.metadata.connections....
-3
votes
0answers
28 views
0
votes
0answers
28 views
Loading an animation with an Ajax request
I am not sure if this is the correct way to make an Ajax request and do the typical loading/processing GIF/animation while processing is happening and displaying the response.
HTML:
...
1
vote
1answer
22 views
Sidebar menu to hide or expand parts of a form
I have some of my code that I have tried to improve on to make it cleaner and efficient and I would like some feedback to see if I am going in the right direction with what I am trying to do.
I have ...
1
vote
1answer
39 views
Event handler for conditions
I am trying to detect whether a condition is being returned true or false. The only problem is, I have a bunch of if/else ...
3
votes
0answers
69 views
Showing the slide named in the query string and hiding the others
I have this all figured out now thanks to the help of a mod. Here's the working code:
...
1
vote
0answers
33 views
JavaScript / jQuery Memory Guessing Game
I want some tips on how to make my code better, more efficient, better coding practices, etc.
Codepen
...
5
votes
1answer
112 views
Simple restaurant menu
As stated in the title, the code produces a simple drop-down menu that allows you to select your Starter, Main and ...
0
votes
1answer
41 views
While focus on input check if empty
I made a small function that is getting looped when an input is getting focus and stopping the loop when the input is losing focus. Now I would like to know if there is a better way to write this code....
0
votes
4answers
19 views
4
votes
0answers
32 views
Reading and updating an XML address file
I have some code that reads from an XML file and updates if needed. I want to move some of the stuff around. Here is the code overall:
...
0
votes
0answers
39 views
JS timer plugin
This code operates as intended, but with only with two operational timers running. I need the resize event in the match section as I need to retrieve the window ...
3
votes
3answers
72 views
Wikipedia Viewer
This is one of the projects on freecodecamp. I would like a review on my code. Thanks in advance.
Javascript:
...
4
votes
1answer
64 views
A Game Of Simon
This is one of the projects from freeCodeCamp. It's a game of Simon (a memory game). I would like a review on my code.
...
3
votes
2answers
66 views
Javascript bar graph representation using CSS
This js was written strictly for a visualization of a graph redesign included in a stats report within our game systems. It all works properly, but I know there has to be a much neater way to organize ...
2
votes
2answers
43 views
Selecting one form to be visible using jQuery
I'm new to JQuery but have managed to get it working the way I want. The problem is, it's a bit convoluted and could easily get out of hand if I add more options.
I am trying to show and hide divs ...
5
votes
2answers
147 views
My online hangman solver
I've created a simple hangman solver at solver.lukesalamone.com, and although I'd consider myself proficient in webdev I am by no means an expert. The trick with this is that since HTTP is stateless, ...
2
votes
1answer
40 views
jQuery menu state is-active
I have this menu in jQuery that works perfectly, but I think it would be better if, instead of using class="btn-accordion" for each ...
1
vote
0answers
27 views
Selecting up to three thumbnail images using jQuery
I have written something in jQuery but I'm not sure whether it is an elegant solution. Every click needs to check the DOM for classes/and add and remove classes. Any feedback or suggestions would be ...
4
votes
1answer
63 views
Javascript promises, multiple api calls in then()
This is the first time I'm trying to use promises in JavaScript so I'm not sure if I have done it correctly but it seems to work. The problem is that I have ended up with a "nested when" and it doesn'...
-3
votes
1answer
54 views
Simple code refactoring in javascript [closed]
This code is working but there's a lot of duplication, how can I refactor it ?
...
1
vote
0answers
40 views
Counting and listing words in a table
I have recently carried out a test for university where I was given the following instructions:
Write a simple JavaScript application that reads paragraphs of text
input by the user and creates ...
2
votes
1answer
79 views
Validate a form using jQuery
I am validating a form using jQuery.
It is working perfectly, but I just feel the code is quite "bulky". There is a lot of if statements being used to achieve ...
2
votes
2answers
49 views
Show and Hide group of classes based on data attributes
Somebody please verify this code. Is this efficient? please tell me modular way to accomplish this task.
Updated
I want to add show class to ...
3
votes
0answers
22 views
Menu of triggers reveal corresponding dialog elements
So I have this code that for the most part, does what it needs to do, but I'm having trouble making it more concise and elegant.
Codepen
Intended functionality:
If you click a trigger, it's ...
1
vote
1answer
25 views
Select the correct input when using input group after pressing a button
Introduction: I'm creating a form using bootstrap and I have different input groups with the same structure and functionality.
All of them have a '-' button on the left and a '+' button on the right ...
2
votes
1answer
65 views
Graphic Ape Designs gallery website
I am currently working on my YR9 (I'm 14) IST web development project and I want to know some tricks for optimizing my website.
I know that I shouldn't have the same CSS rules in the style tag on ...
2
votes
2answers
93 views
Responsive horizontal scroll on mouse position
I am making a responsive horizontal scroll UI. The horizontal scroll position is calculated according to the mouse horizontal position:
...
3
votes
0answers
34 views
JavaScript Audio Player
Looking for feedback on any bad practices and general advice on how I might better structure my code.
...
3
votes
3answers
102 views
jQuery make DRY two almost identical on click function
Is there a simple way to DRY this jQuery code?
...
1
vote
1answer
78 views
Turn script into a function which extracts the div ID and places it inside
Alright, so I've got this script which basically drains the thumbnails and streams from the twitch API/JSON.
...
1
vote
1answer
25 views
jQuery code for displaying server status from XML feed
I am using the below jQuery and HTML to read in and use an XML server status feed for a server widget. This is the code:
XML Feed:
...
2
votes
0answers
33 views
jQuery form change listener, modularized using ES6
I have the following javascript code that I'm trying to modularize using ES6:
...
1
vote
1answer
36 views
Factory that Creates Reusable Class Builders for a Racing App
In a project for fun/practice, I made a few builder classes that all started to feel the same, so I decided to generalize them by creating a factory that would automatically assign the similarities ...
1
vote
0answers
27 views
Pomodoro clock in js
I created a JavaScript library on Pomodoro time management method. I don't know if it's good so I though that you can help me with reviews.
...
0
votes
1answer
63 views
Generating HTML code dynamically with jQuery
I am doing a college project and I would like to write my jQuery code following best practices.
The project involves using the jQuery .getJSON method to retrieve information from a json file.
I have ...
1
vote
0answers
50 views
jQuery placeholder plugin checking
I have been experimenting with jQuery and HTML placeholder plugin for practice work.
I've used this jQuery plugin. I've checked it in IE8 in, it seems it works.
Could you please check and write is ...
5
votes
2answers
97 views
Restrict HTML input field to decimal
I'd like to restrict user input in a form to a decimal with max two numbers before and 4 after decimal point.
Valid values would be:
50
0.1
1.23
4.5678
12.943
...
3
votes
1answer
56 views
Generating jQuery mobile “pages” dynamically
I'm doing a college assignment with jQuery Mobile and JSON. Best practice with jQuery mobile is my main concern.
My html starts off with a main 'page' (data-role="page") inside a div with id="all-...