Questions tagged [jquery]
A JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.
2,358
questions
1
vote
1
answer
81
views
Rubik's cube scrambler with timer and list of solves
This is a work in progress Rubik's Cube scramble generator with timer and list of solves. The list of solves is stored using localstorage so that it stays on page reload. A solve can also be deleted ...
0
votes
0
answers
62
views
Html and CSS editor that runs and saves code
I decided to create this project to put my JS skills to the test mostly, and it works well. It is a HTML and CSS editor that saves your code to localstorage and ...
2
votes
1
answer
64
views
Reorganice (and style) form's output in HTML using JQuery: how to do it better?
To clarify: The code in "What I achieved" is working. I'm looking for suggestions so I can improve.
I'm quite new with JQuery (and javascript) and I've been learning while styling a forum. ...
1
vote
2
answers
74
views
Changing every link on page, in fastest way possible
I have created a script (mediawiki gadget), which iterates over every redlink in a rendered wiki-page (that is, over every href with class new, signifying an ...
0
votes
2
answers
111
views
jQuery + PHP Form Submit and Refresh
Code below successfully processes and submits data to database. Is there anything else that needs to be included / considered?
PHP (note-process.php):
...
0
votes
1
answer
118
views
Generate HTML from input fields
I am building a small tool to generate a copy and paste HTML block, based on the user inputs.
In the HTML file, I have all my inputs (select, checkbox, text inputs etc).
I based myself on the JS of an ...
1
vote
0
answers
40
views
Display tags on the page coming from the server
There is a site with posts that have tags. The site has a search for these tags, that is, you enter words / letters separated by a space and tags are displayed for you by matches. These tags can be ...
1
vote
1
answer
125
views
Sign Up Page - A mini Frontend Project
I have designed a a small frontend project, a sign-up page. It uses HTML, CSS, JavaScript and jQuery. Being a beginner to frontend development, I want to adapt to all the best practices. I am looking ...
2
votes
2
answers
584
views
Clone Div and change input control
I am using keypress to get all the events of a input control. Once the user hits the enter button after I am then clone a div and update the ids. One project I am having is that I only want to do this ...
1
vote
0
answers
376
views
Select product variations using buttons/swatches instead of a dropdown
In WooCommerce, by default interface, selecting product variations is possible through a dropdown. But, I am developing a site where I wanted buttons/swatches instead of the dropdown.
I achieved that ...
0
votes
2
answers
1k
views
JQuery fixed header that hides on scroll down and shows on scroll up
I am currently working on a site product where I have to create a site-header that is always fixed on top of the viewport but when I scroll down it hides, and again when I scroll up, it becomes ...
1
vote
1
answer
212
views
Chrome bookmarklet to expand examples elements on a dictionary webpage
I created the following Chrome bookmarklet to open all elements with text Extra Examples boxes on this page. For example - the element labeled with text Extra Examples below can be clicked:
When it ...
2
votes
1
answer
157
views
Building HTML in JS and append
I am working on this project where I need to building html from this object. There a a lot of loops and counter and wanted to see if there is a better way to do this
Any suggestions/comments are ...
0
votes
1
answer
255
views
Using localStorage to set and get values for date fields
My input fields for the dates are not saved when the User presses the submit button. The page reloads and the values for the input fields are empty. So I'm using localStorage to save the values when ...
0
votes
1
answer
296
views
Calculate multiple form field values as you type
I'm making a down payment form where the user enters a purchase price and can then enter the amount they want to pay as a down payment as either a dollar amount, a percent down or by using a range ...
0
votes
1
answer
83
views
Build JS object that will be pass into the Handler [closed]
I am working on a web page where I am creating a JS object using {} and []. This object is passed into a handler. I wanted to see if there is a better way to create the object in JavaScript
My logic
...
2
votes
1
answer
476
views
jQuery code to add / remove classes depending on the button clicked
What the code does
What the JQuery code does is add / remove classes on div's elsewhere on the page, depending on the button clicked.
Button 1 clicked → add class ...
2
votes
1
answer
169
views
Creating object in JS that is passed into IHttpHandler
I am working on a web page where I am creating a JS object using {} and []. This object is passed into a handler
I wanted to ...
3
votes
1
answer
339
views
SetTimeout to populate Javascript Object while a function looped AJAX requests to get data
I wrote some code that will get the name and data of a node or multiple of nodes and put them in an object (seriesData) so I can use said object for a chart (renderChart). I used setTimeout() so ...
4
votes
1
answer
334
views
Setting all hidden fields based on id
I am working on a web page where there is a checkbox with a value and a hidden field. I want to ask your opinion on whether this logic is sound.
My logic
The checkbox has a value that matches the id ...
2
votes
2
answers
206
views
validating form before uploading files
This function below return true/false. How I could possibly improve the code quality?
...
0
votes
1
answer
46
views
Show/hide depending on ID and Class
I have written some code that shows a div class, based on what ID is clicked. I'm a beginner, so not sure how to make this code compact, it seems way too long at the moment. Can anyone suggest a ...
0
votes
0
answers
422
views
Find index of element within a list of elements with the same class
I have asked this question on stack overflow however I didn't receive an answer which solved the issue so I created one myself however I am wondering if there is a better/ simpler way to do it.
Say I ...
0
votes
0
answers
387
views
Clicking image makes select option changed, and vice-versa in jQuery
I'm using jQuery version 3.6, and I have image labels that are clickable and when the user clicks on it a select option is being selected. And vice-versa, when a user selects an option an image is ...
1
vote
1
answer
65
views
Convert filter button from plain Javascript to Jquery
I have the following function written in JS:
...
0
votes
1
answer
49
views
jQuery building select control
I have this logic that I wanted to see if there is any better way to build this select control. I am using the includes to look for data in the array and then I ...
0
votes
1
answer
144
views
Upgrade security and code quality of a website contact form
I have a simple website contact form created back in 2017.
The form was developed using PHP, PHPMailer, jQuery, HTML and CSS.
I would like to make sure the code is up to modern standards and secure.
I ...
2
votes
2
answers
104
views
Javascript convert number string to Boolean
I'm making this control toggle between hide and show base on the value in this hidden value. I wanted to use a Boolean because I ...
3
votes
1
answer
296
views
Javascript array from IP address
I want to make this code better. It works now but I think it can be better. I have a working sample on jsfiddle.
When the page loads I have the End IP Address disable until the data is entered. Then I ...
4
votes
1
answer
73
views
Four HTML tabs elements, with fade animations, activated by buttons
I am pretty new to Javascript and trying to make a really simple tabs element which is just hiding and showing sections depending on which button is clicked. I know that this is a terrible way of ...
2
votes
0
answers
70
views
A simple recipe page in HTML, SASS and JS
I've been learning how to design responsive webpages. I got done the basics and can create code that closely resembles the design, but I was wondering what are the best practices in web development ...
1
vote
0
answers
173
views
Split columns moving in the opposite direction when scrolled - in a continuous loop
I've seen something similar and have been trying to refactor the JS. I have two columns of content, which when scrolled move in opposite directions. This should also loop continuously. The ...
0
votes
0
answers
39
views
jquery function updated from javascript
This is original Code
...
2
votes
2
answers
79
views
JS Menu Post Get method
I have this JS ajax GET that returns menus to be used in a view. I wanted to see if there is any more way to write this method. Its a lot of code and just wanted to make sure there is no better way to ...
3
votes
2
answers
318
views
PHP blogging application with AJAX loading
I have been working on an online newspaper/blogging application with CodeIgniter 3.1.8 and Twitter Bootstrap 4.
The latest feature added is lazy loading of posts.
From the Static_model (...
1
vote
1
answer
26
views
A more elegant way of adding option data to a dropdown box using jQuery
The code I have below is currently what I am wanting to see if I can shorten. The code works as-is right now but I don't like the face that each IF statement has its own $each loop in it. ...
0
votes
1
answer
152
views
Building user friendly inputs on a mobile device
I am working on an e-commerce website.
The home page has 2 inputs: Looking for and Location. The user would enter their desired product and location and click on Search as shown below:
The first ...
2
votes
0
answers
67
views
Chess quiz web site
I'm working on a personal project to build a website that quizzes users on chess opening theory moves. I know my code is not very object-oriented but I am working on refactoring it right now. I just ...
1
vote
0
answers
72
views
Here's my attempt at a Volumetric Weight Calculator (in cm). How did I do?
So, I've written this small calculator for computing the volumetric weight of a parcel. I've been trying to kick some bad habits to the kerb lately so I was wondering if I could get a code review. ...
0
votes
1
answer
221
views
HTML table with repeatable rows and live-calculated column totals with row grouping indication
I created a quick "demonstration of proposal behavior" tool for my post on MSO: A proposal to put ALL answerers on a path to curating better content.
Because I have never asked for a review ...
1
vote
0
answers
116
views
Mix JavaScript debounce (not plugin) with jQuery event handler?
I asked this on StackOverflow and was directed here...
Instead of including a debounce plugin library for a very small form section of my site, I've implemented some of David Walsh's JavaScript ...
3
votes
0
answers
82
views
Splash screen library in jQuery
I have created a splash screen library in jQuery. The splash screen will display until the website has completed loading all the images. I just wanted to review if there are any improvements.
Here is ...
3
votes
2
answers
1k
views
Show/hide for multiple IDs
I'm don't know much about javascript, but and slowly learning through using other people's code. The below code I'm using is quite repetitive, with the only variance being the ID names. I feel like ...
2
votes
1
answer
188
views
jQuery: Scrolling down into a content
I got tasked to develop an accordion-like function for a webpage.
The header will always be visible, while the main content (and footer) be styled as display: none;...
0
votes
2
answers
81
views
Reload control using loop
I created this working sample and the code is below. Any advice on how to make this code; cleaner, more effective, just overall better! The data is coming from an API and I need to parse, select the ...
4
votes
1
answer
103
views
HTML <ruby> elements word spacing using jQuery
I'm doing a hobby project for fun recently, it's a GitHub webpage using Jekyll.
One of the main component of my site is displaying Chinese characters with their Sino-Vietnamese pronunciation. I use <...
0
votes
1
answer
26
views
Check Three Dom Elements to See if they are empty or not and return detailed result
I am checking three elements on the DOM to see if they are empty or not so that I can run only the Ajax calls that I should run and save on overall bandwidth. The code works but it "smells bad&...
1
vote
1
answer
88
views
Web-site navigation bar
I'm just starting to learn website coding with html, css, and JavaScript. To get a bit of a hang for it, I'm trying to build a complete web page.
So far, I've only done the navbar. I started with a ...
0
votes
1
answer
37
views
How can I have jQuery code further optimized?
I would like to see if my code below can still be optimized, resulting in lesser lines of code. My code retrieves the values from a multiselect field and assign them to hidden fields that will be ...
2
votes
0
answers
43
views
Copy the reply button to each comment thread in WordPress. Converted from jQuery to JavaScript
I converted an old Wordpress Plugin of mine from jQuery to plain JavaScript using a cheat sheet. I was very surprised that it seems to work right out of the box on my first try.
...