Questions tagged [jquery]
A JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.
2,320 questions
1
vote
0
answers
44
views
A calendar event element
Below is code for a front end calendar event element I have just finished. Though I have been programming in JavaScript for a while, this is the first time I have created a custom class and element, ...
1
vote
1
answer
110
views
Calculate Prime Number using web workers and Web storage in HTML5
Take a number input (less than 100) from the user and save it to the web storage. Create a web worker to increment the number till it becomes prime. Provide two buttons of 'Start' and 'End' to start ...
4
votes
3
answers
271
views
Get the contents of a table cell for all selected rows
I have a table of user info. When you click the button, I want to get the email address from each selected row, output into a comma-separated string.
I got it to work with the following code, but I'm ...
1
vote
2
answers
209
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 ...
2
votes
1
answer
103
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
137
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
215
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
177
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 ...
2
votes
1
answer
138
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
1k
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 ...
0
votes
2
answers
3k
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
291
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 ...
3
votes
1
answer
184
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
454
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
426
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
141
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
841
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
191
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
579
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
602
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
273
views
validating form before uploading files
This function below return true/false. How I could possibly improve the code quality?
...
0
votes
1
answer
96
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 ...
1
vote
1
answer
101
views
Convert filter button from plain Javascript to Jquery
I have the following function written in JS:
...
0
votes
1
answer
75
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
186
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
150
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
402
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
119
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 ...
3
votes
0
answers
87
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 ...
2
votes
2
answers
118
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
351
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
47
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
261
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
93
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
1
answer
313
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 ...
3
votes
0
answers
129
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 know if there are any possible improvements.
...
3
votes
2
answers
2k
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
238
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
143
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
151
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 <...
1
vote
1
answer
45
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&...
2
votes
1
answer
124
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
59
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
56
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.
...
1
vote
1
answer
166
views
Selecting multiple checkboxes to show similar but different boxes
I have 3 checkbox's with 8 different combinations and outcomes.
Selecting no checkboxes shows no divs.
Selecting one checkbox shows the colored div.
For example; clicking the red checkbox.
Selecting ...
3
votes
1
answer
193
views
Submitting form jQuery checkboxlist
In my requestForm submit function I have this logic that checks three checkboxes and then displays the label with an error message. Is there better logic? I would be happy for any kind of feedback ...
0
votes
2
answers
66
views
Simple terminal style message logger
I have a short function written in JavaScript using jQuery which takes a message and appends it to a div. It does this one character at a time with a small delay between characters, and then returns ...
2
votes
1
answer
52
views
Better way to work with clickable regions of window
The Goal
Basically, what I'm looking for is the ability to click a region below an image to trigger a click() event which will scroll the window to the following ...
3
votes
2
answers
123
views
JavaScript function that reuses a modal for adding, deleting, and viewing an item
I have a table that has buttons per row that makes views/edit an item in a modal and they have a layout like so:
...
2
votes
1
answer
241
views
Reusable function for a validation process
I previously asked how can I simplify a validation process:
How can I simplify this JQuery validation process?
But in hindsight, what I really meant to ask was how can I turn that process into a ...