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

learn more… | top users | synonyms

6
votes
2answers
92 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
34 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 ...
1
vote
0answers
15 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
34 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 ...
1
vote
0answers
37 views

Interacting with database in MVC

When using MVC 4 Razor (I am new to web), I get concerned about my understanding of interactions between the database and the client. Much like all apps these days, there is a lot of data that is ...
3
votes
1answer
42 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
0answers
15 views

Using Jquery mobile looping and displaying in listview <li> [on hold]

How to loop through below mentioned document.getElementById("demo1").innerHTML = message[0].FirstName; using Jquery and display in listview . here is my code var message = ...
2
votes
1answer
50 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. ...
0
votes
0answers
22 views

Return all string values in nexted array recursively [on hold]

I would like to recursively check and return all the 'name' strings in the data object. This code works fine. But it worries me that i am using a lot of loops and conditionals. Would greatly ...
1
vote
2answers
34 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
922 views

Refactoring multiple `else if` code

I think I can refactor this: ...
1
vote
1answer
30 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
42 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, ...
2
votes
0answers
24 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 ...
0
votes
0answers
21 views

Only able to zoom the first or the last image on the slideshow [closed]

First of all, I am sorry if I have to move this question here, considering that in stackoverflow it still dons't have any answer yet since yesterday. HERE IS THE DEMO I have an images slideshow ...
4
votes
2answers
53 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
23 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
69 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
37 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
42 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
75 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
39 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
97 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
44 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 ...
1
vote
0answers
50 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
192 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
78 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
42 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
54 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
48 views

Dynamically create a table with values from an object

I want to create a table that looks like this: ...
3
votes
0answers
53 views

My first jQuery plugin

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
74 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
42 views
3
votes
1answer
47 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
38 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 ...
0
votes
0answers
40 views

gallery.js with next/prev navigation and swipe function

This is a simple gallery script which I’m using in my website. The script is loaded in the body. (Everytime the user clicks a navigation-link to some page with a gallery, it is loaded.) I thought ...
1
vote
0answers
90 views
3
votes
1answer
73 views

Can this form validation be simplified made to memory leak free for all browsers?

I am doing a validation and I believe that there are many things that can be reduced or removed. I am still re-working this. But I am looking for some experts to look at my code and offer the very ...
0
votes
1answer
46 views

Checking number of of columns in a row

I have a own made grid system and made a jQuery function for that to check if there are not too many columns in each row. If so, ...
2
votes
1answer
54 views

Simplifying AJAX success code

Please take a look at this Fiddle. Is there a better way of building a table with titles in the first cell of each row, like this: ...
0
votes
0answers
21 views

What would be a better way to add a table to another table?

I was coding a plugin when I've noticed that there was probably a better way of writing this. ...
0
votes
1answer
44 views

Getting data from the server via JSON callback and parsing the data to HTML

I'm pretty new to web development with JS and was wondering if anyone can tell me how I can improve my code. I just feel like when it comes to maintainability my code would be very difficult to ...
3
votes
3answers
83 views

Optimize jQuery selectors code

I have this fiddle http://jsfiddle.net/L7zuT/ where I'm working on a small part of a big event program. The functionality is ok, the part of the problem would be the large JavaScript lines needed with ...
1
vote
0answers
26 views

Optimizing jQuery table building by replacing appends with string concat

I've wrote some code to create a grid of data, however depending on the size of the grid being drawn, IE8 shows a warning message about a long running script. I've read that multiple appends are a ...
2
votes
1answer
40 views

Writing my own jQuery plugin

I am trying to write a jQuery Plugin from a piece of JS code I had written. What this plugin does is it converts a select box into a map of Australia where I can select individual states. It's ...
3
votes
1answer
37 views

Personal Project for managing my Bookmarks - v2

I had asked earlier for review of parts of my JS file earlier and review of the complete JS file of my project. Now I have made changes as per the suggestions. Here are the files. I would like to get ...
2
votes
1answer
47 views

jQuery grid-system - handing different row widths

I made a function in jQuery for my home-made grid system. When a row has too many columns in it, it removes the HTML code from ...
2
votes
1answer
78 views

Refactoring a Instagram widget feed function

I've adapted a Instagram widget from this example so that it now appends 8 images to their respective IDs using a Instagram username. I want my widget implementation to be better and more efficient. ...