Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [jquery]

A JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.

-1
votes
1answer
22 views

Advice needed with optimizing JavaScript For Loop function [on hold]

I need help optimizing the following jQuery code. The below jQuery snippet has been partially optimized to use a native JavaScript for loop to make some alterations to the html instead of using the ...
3
votes
0answers
29 views

Dynamic Bootstrap 4 modal using JavaScript OOP

I have created dynamic Bootstrap 4 modal using JavaScript OOP. Please verify and give your reviews how I can improve the code. I have passed four parameters to create a dynamic modal: ...
1
vote
1answer
30 views

Thoughts on using curly-brackets-less while loop with a try/catch? [on hold]

I need to fetch data from an server that isn't always reliable and unfortunately fixing that is out of my hands. My team determined we would attempt the request up to 3 times. So I thought of using a ...
5
votes
2answers
49 views

Crystals Collector game with four clickable buttons

I'm a few weeks into javascript and had to make a simple "crystals collector" app. The app works as intended, but the code is obtuse and repetitive. I'd like to make the app work using just one on ...
2
votes
1answer
62 views

Toggling a class in JS

I'm toggling the class of an element with this code but I'm pretty sure it can be written more efficiently. ...
1
vote
0answers
16 views

Simple Form Starts Long Running Task and Watches Progress

Want to level up my skills. It hits a php script that starts a long running export that can take few minutes to few hours. The export script outputs a progress file that this form's javascript uses ...
2
votes
0answers
18 views

jQuery code to display images served by PHP, without reloading

My php page displays a slider of images and when the user clicks on an image(.item), the div below (#team_single) changes the content without reloading the page. Content of the div changes also when ...
3
votes
1answer
43 views

whitelist for textarea and save input to file

I'm working with product codes, so a user can only scan these type of product codes into a textarea. I don't know if my code is best way and good performance. I'm using a whitelist solution for ...
1
vote
0answers
42 views

Combine multiple if statements with multiple properties [closed]

I'm looking into using my loop to combine and narrow down this piece of code into maybe a switch statement or other methods, how would I be able to achieve that? This is what I have so far which has ...
3
votes
2answers
41 views

jQuery dynamic toggle class function

I wrote this function that will toggle a class of a targeted element. Applying the class js_class_toggle to any element will trigger the function when clicking on ...
2
votes
0answers
47 views

Make Pagination using Ajax with Jquery, PHP [closed]

This is the first time that I have add (I mean, I try) Ajax with Jquery to PHP and Mysql (pagination). This is a link to the test page: testpage1 I think everything works, but is it done correctly? ...
1
vote
0answers
29 views

Tic Tac Toe finish the game function [closed]

currently i am working on javascript. Learning deep etc. So i decided to made my own tic tac toe game 4x4 without any tips. Then i stucked. If anyone can help me will be perfect. Game is playable ...
2
votes
0answers
25 views

jQuery popup menu function

I looked around for a script for popup menus in jQuery, but all i found were complex and largely-coded plugins. I decided to write a small script myself: ...
2
votes
1answer
51 views

jQuery element reloader

I have looked around for an already existing script for this, but couldn't find one, so i decided to make my own. The point of this is to make it easy to reload an element, whether its a form or a ...
2
votes
1answer
33 views

Alert about duplicates and remove them

So I want ask if I'm doing it right way. Im still learning.. I want check textarea duplicates and alert if duplicate and remove it. ...
0
votes
1answer
31 views

Is there any better / improved / optimise way to approach these input checker? [closed]

Actually I got a form with multiple input (around 39) on which I wish to perform some check and display customs messages based on sets of conditions. I found a way to address my problem but I'm ...
1
vote
0answers
17 views

Enable/Disable Popper.js tooltip if element exists

I would like to disable the popper.js tooptip if there is an element with a specific class on the page. Let me explain ... I have a plugin that creates notifications dynamically, these notifications ...
2
votes
1answer
65 views

Passing data to HTML template

How can I pass data from database to my HTML template without putting PHP code in my HTML file. Thanks. This is my controller ...
4
votes
1answer
172 views

BlackJack in Javascript

I have completed my initial version of BlackJack with Javascript and some JQuery. Any thoughts of this version? I can't seem still to implement timer successfully as I have commented out. After ...
1
vote
1answer
49 views

Upload image without src attribute

We gave an option for user to Upload the image Image is uploading fine, but its not adding any img src tag for that uploaded image.... Is this is acceptable to upload image without using any img tag ?...
1
vote
0answers
38 views

Sliding marker on link hover and click with jQuery

The code I'm bringing forward is for a vertical menu, where I needed a marker to do the following: When hovering over a link the marker should slide down next to it. When not hovering over a link the ...
2
votes
1answer
41 views

Edit button toggles modal and load data from PHP using AJAX and JQUERY

I've been working on an edit/update button that will toggle a modal that looks like this: Is there a better code for this JavaScript code that I made? ...
2
votes
1answer
35 views

Rendering elements (which can change numbers) using jQuery

Currently when the user selects some tags in my app I generate them in a function, like this: ...
3
votes
2answers
46 views

Sliding marker on link hover with jQuery

The following code is for a vertical menu, where I needed a marker to slide down next to a link upon hovering over said link. Therefore I needed to change CSS properties of a HTML element (the top-...
6
votes
1answer
55 views

Fetching movie data using jQuery

Requirements Display movie datas inside all tags that have the class movie_list Make an ajax call for fetching movie datas Fill loading text before fetch data If any error occurs during loading, the ...
2
votes
1answer
51 views

Fetch text values from JSON and Display pop onclick text

I have below code which will fetch the text from json & onclick text , display pop up box in page.... Now i need to give options to change font-family, font color.... But Adding the code in the ...
1
vote
1answer
41 views

Loop through data layer and display dynamic content [closed]

The purpose of the pricingTest object is to grab pricing information from the dataLayer on the page and render content blocks accordingly. My goal in posting this is to hopefully receive some feedback ...
1
vote
1answer
136 views

User upload & Drag image and update text

I am allowing user to upload images & drag uploaded image once user click on mask images, also gave an option to Edit the text.... I am fetching mask images and text from json file.... I am ...
0
votes
1answer
83 views

Updating values in a database

I'm using standard jQuery Ajax to update values in the database and reflect the result in an output. This repetition seems like bad practice and I don't know enough about jQuery to consolidate this ...
1
vote
1answer
62 views

Edit and delete uploaded images code inside script tag

I am Displaying mask images & allowing user to upload the custome image inside mask image, now i want to give an option for user to Edit & Delete the Uploaded image.... Video link : https://...
2
votes
2answers
45 views

jQuery redirect form

I'm using jQuery to create a (hidden) form that redirects people to another page using JavaScript. ...
1
vote
1answer
39 views

Switching to next select field by class of parent

This emulates behavior of tab and shifttab with → and ←. I.e., switch focus to the next/previous select field with parent class ...
1
vote
0answers
27 views

jQuery plugin linked with dataTable

I have no problem, but I would like some advice: I've read some help to do some jQuery plugin, and I just did my first one. This plugin helps to generate dynamic datatable: Autofill the table with ...
1
vote
0answers
21 views

Load more and filtering - WordPress AJAX

In my WordPress theme I have built a function that uses Isotope Layout by Metafizzy to accomplish filtering and sorting. I have used a mix of AJAX and JQuery to accomplish this, however I feel the ...
0
votes
0answers
30 views

Showing and hiding information with photos

I have been given an extremely loose design to follow: a page must show people's photos and name in a text overlay over the image, and when clicked a bio shows below. Must Haves Photo, text overlay ...
-2
votes
1answer
39 views
1
vote
1answer
79 views

Upload and drag the image inside a mask image

I am allowing users to upload and drag images with this code. Give me a review of this. Codepen ...
3
votes
2answers
78 views

Use weather API to get information in JavaScript + jQuery

Please can any code experts review and improve my code? HTML ...
0
votes
0answers
11 views

Collapsible left-side tree

I was wondering if there is a better way to write the following code? The code is working, I am looking for better technique to achieve the functionality, if any exists. Never mind the classes that ...
1
vote
1answer
50 views

When slide show web page is reopen, the web page loading is very slow

Here is a script that opens about 200 pictures, the first time you open the webpage, loading of the 200 pictures is fast, However if you reopen the page, it takes about 4 minutes to load the same page ...
1
vote
0answers
20 views

jQuery plugin for allowing only digits to be entered in html form input

I wrote this small jQuery plugin to set some fields so that they allow only 0-9 digits to be entered. I intended to do that by preventing user from typing, pasting or dropping non-digit content. It ...
2
votes
1answer
146 views

Symfony AJAX comment system with votes

How can I improve this code ? It was quite hard to implement AJAX comment system in Symfony 3, and result is a bit of mess: Controller: ...
0
votes
1answer
102 views

JavaScript Tic-Tac-Toe

The first function makes 2 players ...
0
votes
1answer
101 views

On form inputs focus, show div. hide div on blur for multiple inputs and hidden divs

I posted a question on Stack Overflow and got an answer that works but has a lot of duplicated code. In the future, the functionality may also require a third or more divs to be shown or hidden. The ...
2
votes
0answers
61 views

Python/Django Class based saving

I'm creating multiple Django apps with vote possibilities, so I made an app vote to handle all this votes. In my templates I'm including an ajax-function named <...
1
vote
0answers
55 views

Sorting options within a select element

I am trying to sort the options within a SELECT element. I wonder if I am doing it stupidly or not, so perhaps someone can look ...
1
vote
1answer
170 views

jQuery Slideshow with pagination

The code below is for a slideshow that shows a slide with class active, pre-loads a slide with class next, and holds the slide with class last in the background. My biggest issue with this is there ...
1
vote
4answers
72 views

Replacement function for jQuery .post

Today I just completed a personal POST function that emulates jQuery's using $.ajax, but also implementing a possible redirect. I just finished up and it looks like it is functional, but since this is ...
1
vote
1answer
51 views

A simple jQuery function that removes empty or tags containing just '&nbsp;'

I've made a simple function, this time in jQuery rather than JS, that just removes empty <p></p>, span and strong tags. I'm curious to see what everyone ...