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

learn more… | top users | synonyms

0
votes
1answer
35 views

jQuery Dialog Settings

The goal of the code is to initialize a Dialog with settings make sure the object is reusable Setup the options to reuse the code I'm not quite sure if this is overkill, or I am going about ...
1
vote
1answer
23 views
2
votes
1answer
32 views

Using/storing server-side data on the client side

I've a slot booking script which is as follows: My Current Algorithm A calendar is shown to the user The user clicks on a date I make an ajax call to determine if at least 1 slot is booked on the ...
1
vote
0answers
27 views

Which method is better for checking if jQuery has been loaded in bookmarklet? [closed]

I am creating a bookmarklet which requires jQuery. So before I execute the main JavaScript code of the bookmarklet, I have to make sure jQuery has been loaded in the page. So far I have come up with ...
2
votes
2answers
64 views

Creating an interactive tour for a website [closed]

I'm using grumble to create an interactive tour for a website I'm working on (I'm aware there is a plugin called crumble that does this but I want to have full control of the functionality). ...
1
vote
1answer
28 views

Optimization of recursive jQuery images swap function

There's this website I'm working on that needs to swap images every few seconds, like a slideshow or image fade swap in a way, except that you need to target 5 IMG tag elements. I was able to make a ...
-1
votes
1answer
31 views

Dropdown Form to Link to Another Page [closed]

I'm trying to create a dropdown form that will allow me to link to another page after the user clicks on one of the dropdown items. I've tried searching forums and lynda.com (this code is based off ...
2
votes
1answer
63 views

Checking if switch is checked and doing something with the data

How can I optimize this code? ...
4
votes
3answers
123 views

Tic-Tac-Toe Game

I want recommendations on how to improve this code. JSFiddle for you to play in (It's laggy, so it would be better if you download the images and try it in your own PC). ...
11
votes
2answers
493 views

Checking conditions before allowing a play button to become visible

I have this code to check a couple conditions before allowing a play button to become visible. Is there anything to do to consolidate this code, possibly shrink it down some? ...
2
votes
2answers
146 views

Efficient way to iterate over elements of array for matching contents of another array

Using jQuery I'm trying to find an efficient way to iterate through an array excludeMe and check if elements from another array ...
7
votes
2answers
265 views

Improving nested for loops for sub menu creation

I have a nested loop which creates a drop down with 3 levels. Works fine on modern browsers but on IE8 it hangs and takes several seconds when there's even a moderate volume of data. It creates a ...
0
votes
0answers
17 views

Reading values from JSON

I would like to improve my code performance. Can you review my code? I am using Backbone Marionette plugin and it's reading the values from JSON. ...
4
votes
1answer
70 views

Optimizing display of various famous quotes

If it is possible, I'd like to be able to mash all of my arrays into one array, but still have the same functionality within my function (pick quote, pick creator, set padding). Pastebin ...
5
votes
1answer
59 views

Cover letter generator: guides writing a template and autofills information

This is my first public web-application. I'm a beginner to JavaScript and this is my first time using jQuery. It's not complete, but I'd love some feedback on the programming and the functionality. As ...
1
vote
2answers
80 views

How can I simplify similar functions using a hover state with different div content?

Updated: I need some help simplifying the code below. It works just fine, but maybe there is an easier way. What I'm trying to achieve: Hover over the img then use Greensock Tweenmax on hover to ...
6
votes
2answers
106 views

Wrapping my head around these wrappers

I've been developing a page that is designed like this: ______________ | | | | | | | | | -------------- Everything is wrapped in a ...
3
votes
1answer
59 views

Idea of 'parser' to make the writing of asynchronous functions chains easier

Why this thing : I work on a project where I need to call many asynchronous functions to get data, chain them, execute them if conditions are met,.. and I ended up having unreadable code. At some ...
2
votes
0answers
40 views

Feed API to display RSS feeds Ted talk

I am trying to create a webpage that will read RSS feeds from the TED talk website and display it on a page. I am using Google's Feed API for this. Here is the link to view the code online. Could ...
1
vote
2answers
52 views

Menu selector code that changes the background of a selected div

i made this code to change the background color for a div in set of divs while disable the rest divs background it work fine as it look but i wanted to review the code for more improvement since I am ...
2
votes
2answers
99 views

Interacting with database in MVC

When using MVC 4 Razor (I am new to web development), I get concerned about my understanding of interactions between the database and the client. Much like all appilications these days, there is a lot ...
3
votes
1answer
45 views

Simpler way to write my animation code

I have wrote some animation code below, and it's what I class as oldschool. As you can see, there is a lot of repeating code. Ideally I would like to be able to take the delay and left or right ...
2
votes
1answer
71 views

Improved lightbox2-fork

I found a nice lightbox2-fork, which I tried to improve. After about six hours of work the code passes jslint. I also tried to change variable names for better understanding of what they are for. ...
1
vote
2answers
38 views

Making the save and cancel buttons editable

The following code makes a div tag editable and handles the save and cancel buttons. But there is a lot of duplication. How could I remove the duplication on this? ...
4
votes
4answers
931 views

Refactoring multiple `else if` code

I think I can refactor this: ...
1
vote
1answer
34 views

Zoom in/zoom out jQuery plugin

I created my first plugin in jQuery and just want some inputs on how I can improve the code and features. Here is the fiddle ...
2
votes
1answer
45 views

Simple text toggling

I made a simple AngularJS text function. The purpose is to provide an array of content to display. A 'slider' will be made with next and previous buttons that hide on the last and first slide, ...
4
votes
1answer
52 views

Homemade Lightbox and Image Gallery

I'm new to JavaScript, and I've built a lightbox for an image gallery. There's a button to open the gallery, plus forwards, backwards, and close buttons, and keyboard controls. Currently, everything ...
4
votes
2answers
55 views

Conditional Branching Using Filter

I'm using multiple jQuery filter functions to affect the background color of select objects based on the selected option and it works, but it seems bulky/redundant. Does anyone know how these filter ...
1
vote
1answer
34 views

Navigating around ul li and looking for the active state on the current slide

How can I rewrite this in a simpler way? ...
4
votes
2answers
63 views

Merging single line methods

I am adding click events to list items, and then calling a method for each. Each method doesn't do much other than calling another method. I think it can be improved. ...
5
votes
3answers
72 views

DRYing out a basic image slider

I built a very basic image slider, but I'm still having trouble refactoring. I caught myself reusing same code for clicking the previous/next buttons, selecting a slider dot, and the automated ...
2
votes
0answers
40 views

Refactoring JavaScript functions that differentiate only by condition and return value [closed]

Currently I have 3 functions which are really similar. They differentiate only in input parameter name, condition and return value. I'm going to refactor them, and I thought you guys might tell me ...
3
votes
1answer
44 views

Can this date-validation function can be simplified further or is it the correct approach?

I am doing a date validation. I have no. of pages, which have the date field. User can input the date like "220875" or "22AUG75" - I need to test both and check the length as well. ...
5
votes
2answers
80 views

Small jQuery mobile plugin to handle touch events

Why this plugin: I am developing a mobile app - at some point, I felt like this would be a good idea to give the users the possibility to control everything in the app with touch gestures, hence the ...
4
votes
1answer
47 views

Multiple drop down validation

I have written some jQuery which validates a group of drop downs. It checks the text value selected in all the drop downs (first three characters), and if there is a duplicate, it warns the user. ...
4
votes
2answers
103 views

jQuery Dropdown Navigation

I've written some jQuery code that works, but I'm a novice in jQuery and I want to know how to improve my code if possible. I know I have 3 near identical blocks of code. If I create a function, the ...
3
votes
1answer
47 views

Send parameter to server and reload page

My first ASP.NET MVC 6 / jQuery web site - the site header has a "Change Language" selector (named LanguagePicker) - this is actually placed in a _Layout view, a ...
2
votes
0answers
65 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
1answer
35 views

Set up event on class and initialize state [closed]

Very similar to this question, I'm curious about common patterns/best practices for handling events in coffeescript classes, particularly when you also need to call the event handlers immediately to ...
6
votes
3answers
197 views

Refactor jQuery multiple click() event handlers

I'm using basic jQuery to render tab data. I was wondering if anybody could comment on how to refactor the click() event handlers, and any general guidance or advice. Here's the code/output in ...
2
votes
1answer
90 views

JavaScript eBay Listing Generator

I'm still pretty new at JS and, frankly, this is probably a little above my skill level. But here's my attempt at a script that will take user input and produce a custom interactive eBay listing. ...
2
votes
0answers
67 views

Ember.js file upload code

I am a newbie and tried to find the laziest way to do a file upload using EmberJS, jQuery and formdata (IE10+). The code might look stupid, but it worked. Can you please take a look and give some ...
1
vote
1answer
58 views

Better way to write 'bulky' function in jQuery

I have this function that works fine, but it looks really ugly and repetitive... Basically I have a featured profile and underneath I have 4 smaller thumbnails, on click I want to populate the large ...
3
votes
1answer
51 views

Dynamically create a table with values from an object

I want to create a table that looks like this: ...
3
votes
1answer
71 views

Converting <li> tags to horizontal responsive barcharts

I am writing my first jQuery plugin that converts li tags to horizontal responsive barcharts. I am looking for some feedback and suggestions regarding the ...
3
votes
1answer
98 views

Update database, reload page then show a success message

I have spent a long time trying to find a way to do the following: Update a MySQL database with AJAX Reload the Page to show changes Show a success message I think I have finally found a way! ...
1
vote
1answer
45 views
3
votes
1answer
48 views

Activating image and video carousels

I am using this jQuery code to get two carousels working in bootstrap, and it's working for me. ...
0
votes
1answer
39 views

jQuery solution for a client's site

I'm in the process of working on a client's site. I have a section containing a ul with list items and a div containing the ...