Questions tagged [jquery]

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

Filter by
Sorted by
Tagged with
2
votes
0answers
37 views

Improving the speed of loop in javascript for objects

So I have a loop that works great, but doing some testing I notice it is a bit slow. I get an average time within the loop of about 0.11 seconds. Include that with some arrays containing a length of ...
-2
votes
0answers
31 views

Append div in labels as helper text. With in each radio group and its wrapper div [closed]

fiddle link I want to append a div in labels as helper text. within each radio group and its wrapper div. I have a radio buttons group code generated dynamically, so I can't add static helper text ...
3
votes
0answers
58 views

Video player UI in Javascript/JQuery

I am a Javascript/JQuery beginner working on my first ever project. Everything in this program is working as it should and I am happy with its performance. I have pieced it together from a variety of ...
6
votes
2answers
129 views

Turtle Doodle (my first web app)

Turtle Doodle presents several panels which arrange themselves responsively. There is a canvas where the Turtle will move, leaving a paint trail behind him. A control panel allows various commands to ...
7
votes
2answers
153 views

eCommerce Mockup App in JS

I have completed this mockup eCommerce app using Javascript. This version can add products into a shopping cart and automatically calculate the order summary in the shopping cart. It can also delete ...
1
vote
0answers
26 views

How to splits blade files that contain javascript?

I have these scripts ...
2
votes
1answer
51 views

Add or remove a class on two elements when two different events fire

I want to add/remove a class on the html and body tags in the dom when my nav menu is opened or closed. Is this the most optimal way of writing this logic? ...
1
vote
0answers
21 views

Subscribe once and reuse the Angular Subscription each second

I am creating a web application using Angular 8. This application is all about talking to the stock markets server and getting the Live updates every second. I have one query here. Below is my code: <...
1
vote
0answers
29 views

Simple jQuery calculator [closed]

I am building a simple calculator with jQuery. I can append the value to the screen and when the user clicked the operator the first values are clear or empty. My question is, how can I store first ...
0
votes
0answers
18 views

Sorting, filtering and searching a list using jQuery

This is my first time writing so much jQuery, and because of the amount of content on the page, I get a lot of the following console warning in Google Developer Tools as I'm changing filters: [...
3
votes
0answers
48 views

JS PHP insert data in database - is it secure enough?

I'm working on a webapp and I'm using js/php (php and jquery latest versions). Is there anything I should do to improve security? I'm not super worried about safety as the current users are using a ...
2
votes
0answers
93 views

Contact form with AJAX call and secured PHP with Google reCAPTCHA v3

here is a code of a simple contact form that I have created, I believe that the form is server-side protected against empty fields, header injections, CSRF, XSS, bots using 'Google reCAPTCHA v3' and ...
3
votes
1answer
61 views

Ajax function with a callback

I have Ajax function with a callback which fetches all the Patient data however I have some perfomance issues and trying to figure out what it might be, does anyone have idea? That's my Code ...
2
votes
0answers
42 views

jQuery validation for multi-page registration form

I use JS/JQuery validation for radioboxes, input field etc. Because of AJAX I use one global validation (in a separate file) and 4-5 other files to coverage actions in a relevant registration form ...
2
votes
0answers
14 views

jQuery - Etch-A-Sketch implementation [closed]

How could I make my code follow the DRY principle? I feel like they are better ways to do things in my code. So any feedback will help me! js fiddle: https://jsfiddle.net/fr6ut238/ ...
1
vote
1answer
42 views

JQuery Selector in Vanilla JS

I've decided to reproduce the JQuery selector - specifically for finding elements by class name, ID, and tag So for example the tests could be written like ...
4
votes
2answers
183 views

basic jQuery plugin template

I would like to know if I'm writing a plugin for jquery correctly. I followed the official guide and also added some tweaks that I've found from various sources over time. While this works perfectly, ...
1
vote
0answers
54 views

Fills inputs of form

...
3
votes
0answers
40 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
32 views

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

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
167 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
66 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. ...
3
votes
1answer
39 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
23 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
60 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 written the best way possible, or has good performance. I'm using a ...
1
vote
0answers
43 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
55 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
54 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
39 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
28 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
57 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
34 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
32 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
25 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
71 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 ...
5
votes
2answers
230 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
51 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
40 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 ...
3
votes
1answer
62 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
36 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
51 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-...
9
votes
2answers
91 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
63 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
51 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 ...
2
votes
1answer
140 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
64 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
46 views

jQuery redirect form

I'm using jQuery to create a (hidden) form that redirects people to another page using JavaScript. ...
1
vote
1answer
42 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 ...