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
9 views

Getting the value of a input via $_POST when form is passed via AJAX [on hold]

I'm not sure what I'm doing wrong. I have successfully passed a form to my PHP script via $.ajax. however i want to use 2 submits (or button) to either remove or save my form data. PHP ...
0
votes
0answers
22 views

Improving function that does an animation with JQuery .animate()

I'm a newbie with the JavaScript language. So I really appreciate any tip about how to improve my code. I'm used to code in java. Then I want to know if there is any way to abstract my function, ...
0
votes
0answers
28 views

Message-Div animated with changing colors

I've made this animation with jQuery and Animate.css. Could be surely improved. Currently I'm using 125 (5^3) different colors. If one extends the amount of colors, or respectively the filling of ...
1
vote
0answers
17 views

jQuery VLOOKUP() script

The script below demonstrates VLOOKUP by showing which languages appear from column 1 in column 2. Is there a way that I can refine my code to pass in an exact ...
2
votes
1answer
31 views

Updating a stats bar on a page

I'm updating a stats bar on the page after a user action. The code works, but as you can see, it's very messy. Is there a shorter way of writing this function? Seems like a complete mess. I thought ...
1
vote
0answers
47 views

Splitting text into individual characters for animation

I have code which makes use of jQuery and some additional libraries. But the jQuery part is too overwhelming (and thus it does its job slowly). So I tried to optimize it, and faced no luck. Now I seek ...
2
votes
1answer
96 views
+100

Session expiration handler using PHP and jQuery

At this point i am interested to see other techniques on handling session timeouts. What are some good improvements on this script to detect when a session is no longer valid? Important definitions: ...
-1
votes
0answers
13 views

Trying to understand Jasmine testing

Let's say in my application I have a script that triggers a click event on an html id. I want to then test that event in Jasmine. Below is the test I have in place for this scenario. I have a few ...
1
vote
0answers
17 views

Loading multiple remote resources

I've created a class that allows me to load resources, execute a callback after each individual request has been made and finally, a final callback that can assume all said resources are available. ...
4
votes
1answer
23 views
+50

Using EnquireJS to trigger swapping image sources per media query

For responsive images I have come up with a first draft of how I would like to swap image sources depending on media query. This works fine and with the added debouncing function from Paul Irish the ...
0
votes
1answer
70 views

Change the switch code

there is a other way to write in JS the switch statement , This code is working :) ...
1
vote
1answer
24 views

Is this a good way to create a Javascript object? [closed]

I'm building a simple quiz app and wanted to make it more scalable by putting my code into an object. The parameters list looks a bit messy to me. Is this a normal way to use an object or is there a ...
3
votes
1answer
28 views

Optimizing jQuery list filtering

Scenario Currently filtering through a list of ~3100 rows of data presented to the end-user in the form of an index (think, list of car models). This is done in such a way that every item is ...
3
votes
1answer
32 views

Vertical cycle slideshow

I want to make a vertical cycle slideshow. This works perfectly for me but I'm just wondering if it's possible to achieve the same functioning with a better code. I don't know if my code would provoke ...
3
votes
1answer
44 views

OOP and non-OOP versions of layout and page animation code

I am trying to learn how to write more object oriented javascript code, but I am having a hard time understanding the correct way to do it, and how it is useful for front end development. As you can ...
2
votes
1answer
51 views

Stock performance app

I'm building an app that tells you a stock's percentage change in price between two dates by using Yahoo's API. Given a stock ticker and two dates, it currently outputs the percentage return to the ...
2
votes
1answer
70 views

Editing HTML based on instructions in a data structure

My getExtend() function, which will be included via require.js, has two inputs and one output: HTML file content config object which determine how to ...
1
vote
1answer
37 views

Custom form validation using jQuery

Recently I have been doing a bit of work with Contact Form 7 and Wordpress. I've begun looking at form validation using ...
4
votes
2answers
76 views

Parse HTML to modify it

I'm using the following code to parse html, This code is working but since I'm new to JavaScript and working in alone project I would appreciate if you can give me some tips and feedback how can I ...
4
votes
2answers
26 views

Window-size-dependent content toggler for an HTML form

I had to build a responsive component which allows the user to display specific content in a page. I called it the contentToggler. Here is my component in action ...
2
votes
1answer
66 views

CSS3 Dropdown Menu (touch device or mouse compatible)

If you'd like the files: https://github.com/agraymd/Animated-Profile-Menu Working Demo: http://jsfiddle.net/tddfevhv/1/ This may be rather basic, but I wanted to experiment and learn with some of ...
0
votes
1answer
63 views

Wikipedia search using the JSON API

I ask to you. What I could do better in my code or logic? This my example on Codepen -> Wikipedia Search ...
5
votes
3answers
79 views

Fancy checkbox for web pages

I just finished creating a fancy checkbox and am hoping for some tips to help improve my code, as I am still learning. ...
1
vote
1answer
46 views

jQuery toggle buttons to show matching content in sliding panel

I have a sliding panel that I want to show content in. The content that I want to appear depends on the button that triggers the sliding panel. My project is growing rapidly and I would like to ...
-2
votes
1answer
36 views

Dropdown menus with toggling ⬇︎⬆︎ icons

I have some html and js codes. I can't understand how can I dry up this codes. I am using bootstrap-3 and jquery-1.11.0. on my js code I have some dropdowns. In dropdown I used a icon. When the ...
1
vote
0answers
20 views

Make jquery pagination more efficient

I am trying to create pagination with pure PHP and jquery. I have done this and it works exactly how I want it to work. Essentially I get all products from my database using PHP. I then populate the ...
1
vote
1answer
53 views

Focus next element on keypress

It's been a year or two since I last dabbled in jQuery and have attempted to write a simple "on key press move to the next element" script. However my first attempt has a lot a repetition. I just ...
4
votes
2answers
53 views

Calculate the difference between current date and age from personal ID

The goal is to show message for users that are less 25 years old. The personal ID consists of 081010333333, where 08year, 10month, 10date. I made code and it's very messy. So the question is: how to ...
3
votes
1answer
41 views

Place Ajax request on completion of Ajax Request

I have an Ajax request which in turn on completion make another ajax request. Is this good? How can it be improved? ...
0
votes
1answer
28 views

Passing model to _layout.cshtml

I have login page that looks like: It has a ViewModelBase and a ViewModel as: ...
0
votes
1answer
30 views

Collect several API call results

Want to brush up my rusty web dev skills. I want to call the twitch API for several channels and eventually call a callback function when all results are in without using a sync call. I didn't work ...
-1
votes
1answer
41 views

Changing sales stage

I think this code is not optimized: ...
2
votes
1answer
37 views

jQuery templating with ES6/ES2015 template strings

I have been using a particular pattern over and over again when I want to keep my jQuery apps more safe from XSS. I do something like this. (It uses ES6 template strings) ...
2
votes
3answers
91 views

Javascript Ownership Cost Calculator

Javascript newbie here. I built a total cost of ownership calculator to calculate the cost of a business over 5 years. It has a lot of repeating script and prob way more congested than it needs to be ...
0
votes
0answers
32 views

Event Delegates using IIFE or Module

I am learning jQuery/JavaScript best practices and am attempting to put them into practice. My overall goal is to have lots of small, independent .js files which contain specific functionality and ...
1
vote
1answer
64 views

Match values inside object and add them

Does the following code is written correct witout redundant code ? or maybe using Jquery it can be written better? I need to find matching between properties insdie oData & oPushObj and fill ...
2
votes
1answer
76 views

Overriding the mouseout handler for an image when a button is clicked

I had posted this question in Stack Overflow and they told me it would be better served on Code Review. Is there a more effecient way of changing the mouseout state when a button is clicked? When a ...
3
votes
1answer
105 views

Simple JavaScript quiz application with radio buttons

I've created a simple JavaScript application, which also happens to be my first-ever piece of code in any programming language.It took me two days to get the core correct and another two days for ...
3
votes
2answers
147 views

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
107 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
127 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
33 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
39 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
39 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
98 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
41 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
72 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
51 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
81 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
94 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 ...