Questions tagged [jquery]

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

195 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
204 views

Client-side routing using Knockout and HTML5 History API for a single-page web application

The full question is... "Please, how can this code base or project (for client-side routing using Knockout and HTML5 History API) be further enhanced as regards security, production-readiness, ES6, ...
4
votes
0answers
43 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: ...
4
votes
0answers
84 views

Backbone learning piece, Movie Application using Views, Collection, Models, Routes and Localstorage

I have created a Backbone Movie app as part of a learning exercise, the app is hosted on codepen although I actually have it built on my local but thought this approach would be handier for code ...
4
votes
0answers
366 views

Write a HTML table from MySQL tables

I have a piece of code that generates some tables: bp_rows: where I take a snapshot of some "headers" for each row of the table. ...
3
votes
0answers
46 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 ...
3
votes
0answers
38 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: ...
3
votes
0answers
122 views

jQuery animation tab slider

I'm a beginner in js and jQuery. I wrote animation tab-slider. But my code is bad. What should I improve? What should I do to make the code less cumbersome? ...
3
votes
0answers
47 views

Search feature built with jQuery AJAX

This is front end code for a search feature that searches for characters. It uses the users search query to return an array of matching characters, which then gets displayed in a search list for the ...
3
votes
0answers
820 views

JavaScript quiz game

Here is the JavaScript code: ...
3
votes
0answers
490 views

jQuery Plugin, multiple instances/elements with different options

I was having some real issues creating a jQuery plugin that could handle multiple instances with different config options. I came up with this, but am not sure if it follows best practices. I used ...
3
votes
0answers
44 views

Image placement & animation from grid

I have a grid of different sized images. I made a click event function that grabs the image inside any clicked grid-item. It then saves the coordinates and size of the image and animates from the grid ...
3
votes
0answers
819 views

Todo list with drag and drop functionality

I have made a drag and drop todo list. I would like to hear If there is anything better I can do about this code. Here it is: ...
3
votes
0answers
129 views

JavaScript copy paste cell values

The following function gets the lastly clicked cell value and pastes it into the edit box editBox, in which the user can then edit the value. Whenever the user goes ...
3
votes
0answers
751 views

Flask site that uses x-editable to edit elements and update mysql db

This code is built in flask, it allows a user to edit a title and a description of a div. I have used the X-editable library which allows a user to edit text and use ajax requests. I also process ...
3
votes
0answers
34 views

Responsive layout for showing/hiding 4 panels

I have 4 panels that will contains tables for data. There will be instances where a panel will contain no data, so I have combated wasted space with the code below. I'm relatively new to both jquery ...
3
votes
0answers
72 views

jQuery plugin for a lightweight dropdown

I'm working on my first jQuery plugin for a lightweight dropdown. This dropdown behaves just like a ordinary <select>. Before implementing new features I'd ...
3
votes
0answers
110 views

jQuery modal dialog plugin

I'm working on creating a new jQuery modal plugin. I'm pretty good at jQuery but still pretty new to the whole object oriented plug-and-play style of plugins so I used a different plugin I found ...
3
votes
0answers
79 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: ...
3
votes
0answers
413 views

JavaScript Audio Player

Looking for feedback on any bad practices and general advice on how I might better structure my code. ...
3
votes
0answers
63 views

Displaying a list along with multiple event listeners

This is one part of my website, it fetches a list of habits from my Restful API. Each description of habit in list gets append to a list item in the HTML. During this loop, a event click listener is ...
3
votes
0answers
4k views

Simple minesweeper game in JavaScript

I created a simple minesweeper game as I am trying to get my hands dirty in JavaScript. I have tried to use the oops while doing this. I am posting 3 files: index.html minesweeper.js minesweeper.css ...
3
votes
0answers
78 views

Building HTML with JS (function expression vs comment for code clarity)

I'm currently building some HTML with JS (specifically using the jQuery library). My code is as follows: ...
3
votes
0answers
304 views

Appending script elements with variable attributes

eWay has a simple Pay Now button that is embedded as a script. There are other ways to use the eWay API to take a custom payment, but they are slightly more complicated and the idea was to keep it ...
3
votes
0answers
126 views

Ajax file uploader jQuery plugin

I tried to write my first jQuery plugin. It's a very simple Ajax file uploader. I would appreciate a review of this code. HTML ...
3
votes
0answers
383 views

Efficient JavaScript/jQuery typewriter effect that handles HTML5, entities, and text

How should this code be improved? For instance: How could it be shorter, clearer, deal with memory better, use a plugin/library, better prepared for web input? I can break up and clarify the regex or ...
3
votes
0answers
855 views

Paper.js slow resize

I'm currently in the process of redesigning and coding my website, for which I'm wanting to use paper.js to draw on canvas. Currently the only project page I have is using a basic random ball ...
3
votes
0answers
1k views

Wrapper for jQuery Ajax to ensure redirects occur on clientside - Round 2

A while back I posted Wrapper for jquery ajax to ensure redirects occur on clientside on handling ajax and redirects when a server side error occurs. Since that post I've been using this module ...
3
votes
0answers
4k views

Update database, refresh the page to show changes, show a success message

Follow up question for: Update database, reload page then show a success message I have a table of articles, in each row is a button to activate / deactivate the ...
3
votes
0answers
285 views

jQuery Plugin - HTML5 History State

I've built this small jQuery plugin to work with HTML5 History State functions. It's my first jQuery plugin, so I'm not sure if it's up to the best practices, or what could be done better. Keeping it ...
3
votes
0answers
5k views

Overriding sorter and matcher in Bootstrap Typeahead

In this code, I'm overriding the sorter and matcher for Twitter-Bootstrap's Typeahead functionality. The reason for the override is to allow state (technically Jurisdiction) abbreviations to be used ...
3
votes
0answers
2k views

File input control with rounded buttons and styled textbox

We have orange rounded buttons as a standard on our site. For our purposes, we switched everything over to use an anchor tag, instead of input type=button. The exception to this was the File Upload ...
2
votes
0answers
74 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 ...
2
votes
0answers
41 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
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 ...
2
votes
0answers
27 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
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 <...
2
votes
0answers
117 views

Simple jumping game: continue with jquery or switch to html5 canvas?

I'm coding for fun with the secret ambition of making a fun little game for mobile. So I started out building this little jumping game with Javascript and jQuery. The game relies heavy on css ...
2
votes
0answers
23 views

Range value selector jQuery plugin

In need of making a range selecting feature I made my first jQuery plugin. I tried to mimic the structure from some open-source plugins. I wonder if this can be improved. Here is the source code: <...
2
votes
0answers
76 views

A simple “couple creator”

I just made this simple generator as a side-project to one big project I'm working on (demo on github pages here) and would like some opinions, feedback or suggestions on how to improve it. I hope you ...
2
votes
0answers
30 views

My navbar menu with two differents formats/styles

I have a navbar menu with two styles: First one is a tranparent menu. I use it when the page charges. Second one is a scroll and responsive (not yet) menu. I use jquery to transform the first menu ...
2
votes
0answers
37 views

Image slider code

I've been doing this image slider section, I've been working on this code for quite a time, the code is perfectly working but I want to improve it. I tried for hours and couldn't find a way. Maybe ...
2
votes
0answers
45 views

Controller to execute AJAX requests for a client

I have been developing this structure or pattern (I don't really know how to call it). It's my first time doing something like this, and I'm a bit worried about the future, if it becomes unmanageable. ...
2
votes
0answers
36 views

Remove General sibling on Keyup

I am creating a search filter using jQuery and implementing Array.prototype.filter(). What I have done is that I call the ...
2
votes
0answers
46 views

Display results from a JSON response based on game type

This code currently works with no errors. I want to know if there is a way to improve its conding structure, as there is a lot of repetition and it looks really bad. I tried an alternative way by ...
2
votes
0answers
40 views

Event handler re-use in Javascript

I've been trying to deal with a lot of duplicate code in the first web pages I've been working on and have been playing around with the prototype model, which I think is the 'right' way to go about it....
2
votes
0answers
61 views

JavaScript popup component with state depending on existing class

Making long story short, I got a chance to jump from DevOps to Software Development (Frontend). Because I'm quite new to JS design patterns, I need some quality advice about the job I've done recently....
2
votes
0answers
74 views

Create a stream request for Transaction history by client id on Braintree vault

I have been trying to create a transaction history request from Braintree using a client ID on Braintree vault, and it took far too long to figure out how, so here is the code on server that I ...
2
votes
0answers
1k views

JavaScript: Cascading (dependent) dropdowns for country, state and city selection

I have written the following JS to populate dependent (aka cascading) select boxes for country, city and state selection. The backend is a Rails application, which provides the following: Object ...
2
votes
0answers
827 views

Simulate a simple shopping basket

I simulated a web shopping basket for a store with a single product, for two reasons: to learn to use browser events for a user to manipulate data in a page so that, in the future, I can build it ...
2
votes
0answers
61 views

Generate a patch description from multiple SVN commits

I have a Spring app that is used to create patches for another application. My client retrieves a list of branches from a SVN repo through the initial AJAX call, then if one branch is chosen, another ...