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

learn more… | top users | synonyms

-1
votes
0answers
18 views

Simplify table highlighting [on hold]

Looking for feedback on how to better improve or simplify the code below. ...
-2
votes
0answers
10 views
2
votes
2answers
82 views
+50

Driving equation output from select input boxes via JavaScript and HTML

I would like to create a simple interface to allow a user to make a few choices via select boxes and drive a resulting equation. Here's a screenshot: This is a gross simplification and I am ...
2
votes
2answers
91 views

Calling multiple plugins inside script tags

I'm not that comfortable with properly writing jQuery. On my website I've used a lot of jQuery plugins and basically just dumped all the different initiating scripts between two ...
4
votes
3answers
83 views

A reusable AJAX polling function

I have written a small JavaScript function which performs an AJAX request every x seconds. I was hoping some of you could give it a look over and give me any pointers on redundant code or bad ...
2
votes
1answer
23 views

Rendering comments in a Backbone view

I want to make show/hide logic more maintainable in my codebase. Because they are too faraway located in separate js files, it hard for people to maintain. The flow in my codebase is: ...
3
votes
1answer
33 views

Renaming the iframe src attribute to facilitate lazy loading

I'm not great with javascript. I need some code to rename all iframe src attribute names to data-src, for a lazyload plugin to ...
3
votes
3answers
34 views

Set same color as prev row if data matches otherwise different color

I have a requirement in which I need to set color of two or more rows of a table same if they have same value in cell one and I have to maintain this alternatively i.e. no 3 or 4 rows should have the ...
3
votes
1answer
92 views

Clickable and automatic image slider

I created a slider that fades images automatically but you can also click to see the next or previous image. It already works how it should. But I think my code is really heavy. I am not experienced ...
1
vote
1answer
26 views

Polling hash change

I've discovered that Google Chrome on iOS doesn't fire the hashchange event when the back / forward buttons are pressed. Reference: ...
3
votes
1answer
71 views

Fading content for each TD

I have an HTML table and I use jQuery to fade some content for each TD: Demo My code works great, but I want to know if my solution can be better. ...
3
votes
2answers
49 views

Optimzation removeClass() and addClass()

I am trying to simplify and optimize these line of codes. This is a jQuery function controls a <div> to expand up or expand down. This is my coding ...
2
votes
1answer
63 views

HTML Table with Selectable cells

I'm working on a scheduling table that user' can select cells (which will be gathered with jQuery using data attributes) but I'm trying to work out the best way for user' to be able to select rows and ...
4
votes
0answers
39 views

Ajax bootstrap modal form function

I made a few functions to handle an Ajax post request for a form inside a bootstrap modal, and then update the form errors / display a success message disappearing with a timer countdown upon valid ...
2
votes
2answers
63 views

Keyboard handler for selecting radio buttons

I have got my JavaScript working as seen here: https://jsfiddle.net/yLg1qs04/3/ But how do I condense/shorten it so that it's not repeating itself so often and taking up so many lines? ...
0
votes
2answers
35 views

Scaling and cropping an image adaptively based on the window dimensions [closed]

I've tried my best (I'm new to JS) to write a script that make an image fit to its parent div with respect of the ratio and overflowing when needed. For example, if the ...
3
votes
1answer
49 views

Adding and removing classes at different heights on page using jQuery

I want to remove/add classes when the user is at different distances from the top by using jQuery. I have successfully done it, and it works fine, but I think I'm doing it wrong, and I would like ...
3
votes
0answers
36 views

Ajax login response [closed]

I want to create an Ajax-Login, but I'm not sure if my solutions is generally correct. I want to do everything correct, so I need someone who checks this code and give me some improvement hints. ...
1
vote
1answer
62 views

Weather app using the openweathermap.com API

I have been working on a simplistic weather application that utilizes the openweathermap.com API. I have an ajax call to make an HTTP request to get a JSON object that contains the data which is ...
2
votes
0answers
48 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 ...
0
votes
0answers
25 views

Extracting articles mentioned in comments in three GET requests

I need to make several HTTP GET requests and do the following stuff: When all of them will be completed, I need to parse each HTML After HTML parsing or in case of any error I need to set flag ...
0
votes
0answers
13 views

Processing the results of several GET requests via jQuery

I need to make several HTTP GET requests and do the following stuff: When all of them will be completed, I need to parse each HTML After HTML parsing or in case of any error I need to set flag ...
0
votes
0answers
19 views

Sporadic div positioning using Isotrope

I am currently using jQuery + "isotrope" to make an image gallery where images can be filtered using "data-filters". But "Isotope" uses grids to organise the divs but I would like something like the ...
5
votes
1answer
58 views

Front End Web exercise, no HTML

I was given the following instructions Using the below HTML, using ONLY CSS, JavaScript or jQuery create the following (see attached gif animation): ...
0
votes
2answers
49 views

Page for personal portfolio animations

I built my portfolio page using Bootstrap and jQuery, but on lower performance computers the animations seem choppy. I am interested in JavaScript optimization and was hoping you all had some ideas on ...
1
vote
1answer
98 views

Simple JavaScript Calculator

I built a simple calculator that supports addition, subtraction, multiplication, and division. It can also chain operations. I'm looking for feedback on my code for places that could be done better in ...
2
votes
1answer
45 views

If/ else if statements to show and hide

I've got some if and else if statements to show and hide svg elements and it works the way it should but I wonder if I can shorten the code since it looks so repetitive. I'm not sure if it's ...
4
votes
1answer
56 views

Controller for a vehicle servicing AJAX app

I am working on a codebase that operates in the following manner: ...
2
votes
1answer
33 views

Converting a string to two strings

I have the following code that converts a string that looks like: aaa-bbb|ccc-ddd|eee-fff to two strings that look like: aaa|ccc|eeeandbbb|ddd|fff The ...
3
votes
3answers
85 views

Multiple jQuery onClick events

I have a ton of jQuery onClick events. onClick I hide/show different UI elements. I was wondering, how can I tidy the code up ...
0
votes
2answers
62 views

Custom sorting function implemented as a jQuery plugin

I was asked to create a jQuery plugin that would sort homogeneous DOM elements in a given DOM container element. I came up with the idea to attach data-priority ...
1
vote
2answers
74 views

Fetching data from nested JSON using jQuery and displaying in table

I'm displaying JSON data in a tabular format on a html page using jQuery. In the function I'm looping the resp.DATA once to get the key names so it can be ...
1
vote
0answers
28 views

Large table updates using AJAX in Internet Explorer 11 (Cont'd)

Previous topic: Large table updates using AJAX in Internet Explorer 11 For the functions included here, I have taken the advice of the previous answer and incorporated it in the restructure, but am ...
3
votes
2answers
84 views

Large table updates using AJAX in Internet Explorer 11

I have a website which only needs to support IE11. It is a single page application, which has about 200 table rows and each table row has 5 child rows. There is a pulsing function that updates the ...
0
votes
1answer
37 views

Creating a wrapper function for jQuery ajax

I am creating a few functions that wrap around jQuery's ajax function to make it a bit quicker and easier to preform a request. For this I have this JavaScript file: ...
2
votes
1answer
49 views

Updating HTML table (Userlist) with Node.js

I currently have an HTML <Table> with all the socket.io-rooms. Client-side, the table gets fetched if you visit the page. If some room gets created or ...
3
votes
2answers
39 views

Changing images when hovering over links

I wrote a script to change a static image by hovering over navigation links. It works great, however, the script is very long and I'm guessing there is a much more efficient way to write this code. ...
1
vote
1answer
98 views

Keep div fixed when it is inside it's container on scroll

The required behaviour is : The yellow span must be positioned relatively to viewport (position:fixed;) when it is inside the pink div. The height of yellow span ...
0
votes
1answer
48 views

Four jQuery date time pickers

I'm using the Jquery date time picker link here In the four methods below I am initializing the DT pickers but they are all pretty similar except for the ID in the ...
3
votes
4answers
220 views

Color swatch selector with multiple mouseover and mouseout functions

I am working on a simple mouseout and mouseover functions. Basically, I have color boxes (or swatches) and I have to get the color of the specific box when hovered and when selected. You can see how ...
3
votes
1answer
59 views

Small HTML / JS drum machine

This is just a simple little drum machine. Since it loads sounds files, I can't just put it on JSFiddle. I tried Github pages too, but am not sure how to get the sound files working. However, you can ...
2
votes
2answers
243 views

jQuery fade in and out with multiple objects

This set of code is very large, and I'm hoping if someone could show me a more efficient way of doing this. In particular, the JavaScript code, but HTML and CSS corrections are just as welcome. ...
1
vote
1answer
37 views

jQuery - Repeating same actions on different DOM elements

I feel like I’m violating a lot of DRY rules here but can’t think of a better way to do this. I have two event methods (there are actually four total just showing two) that are doing a lot of similar ...
1
vote
0answers
141 views

Progress bar with percentage counter

Basing my work on a JavaScript progress bar created by another person, I added an animated percentage count. This solution is really ugly but it works. I don't know how to avoid having to declare ...
2
votes
0answers
61 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 ...
1
vote
0answers
54 views

Persistent shopping cart that allows users to do CRUD operations as well as perform a checkout

I have never dealt much with jQuery or JavaScript. The following code is something I wrote and while it is functional, I am pretty sure it is a complete mess and it could use some improvements for ...
1
vote
0answers
37 views

jQuery chat queue

The spec for this has changed a lot and due to time constraints the code developed in a piece meal fashion. The problem that I am trying to solve is to develop a queue of chat requests with a ...
0
votes
1answer
42 views

Tabster / jQuery based plugin

I am PHP programmer whom only recently started to play with a bit of JS/jQuery. Because of that my code is probably something that most of You hardocding JS programmers would see as disgrace (again I ...
0
votes
1answer
50 views

Functional Javascript Practice with AJAX

I am currently doing projects in freecodecamp.com to brush up on my javascript skills and just finished a weather report widget. It does the following: Gets api ...
1
vote
2answers
60 views

PHP+JS Code Combining

Just wondering if this is okay to do? I have to store some PHP variable values into LocalStorage. ...