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

learn more… | top users | synonyms

1
vote
1answer
13 views

Generic XHR caching function

I've made a simple caching function for my jQuery ajax calls. I know about the $.ajax() cache setting, but I don't use it for ...
-1
votes
0answers
14 views
0
votes
0answers
6 views

Avoiding duplicate values in jQuery array [on hold]

I have the following code for using with select2. I am using Ajax to get the JSON from Mashape API. I received the object and can retrieve the value into tags. But I am having few values repeating. ...
7
votes
2answers
68 views

Animating a block of HTML on scroll

I'm pretty new to client side scripting and I'm still learning. I've written this JS plugin which animates blocks of HTML (fade-in from left/top/right/bottom) as you scroll down the page. Everything ...
0
votes
2answers
66 views

Password reset process security

Here is what the reset link looks like that goes in an email to the user: ...
1
vote
1answer
37 views

Image slider demo

Since I'm new to web development, I've decided to create this carousel, to practice a bit of JavaScript, more specifically jQuery. I'm really happy with the result, but I'm sure that to an expert my ...
3
votes
1answer
33 views

Improving jQuery scrolldown animations

I'm pretty new to client side scripting and I'm still learning. I've written this JS plugin which animates blocks of HTML (fade-in from left/top/right/bottom) as you scroll down the page. Everything ...
1
vote
1answer
46 views

Using singleton in jQuery [on hold]

I want ideas on how to improve my code. I would like to get information on how the singleton pattern looks in jQuery, and how to let a user pick a file from which to load and count characters. I ...
0
votes
2answers
61 views

Click handlers for edit and save buttons

I have the following code from a JavaScript file: ...
7
votes
3answers
76 views

On hover, hide text and display options

Recently I learned HTML+CSS and a bit of jQuery and am building various web-things to stretch my skills and learn more about how to do things the right way. I was a bit surprised at just how many ...
-1
votes
0answers
8 views

JavaScript Table Sorting - tablesorter (parse on the fly) vs stupidtable (`data-` attributes) [on hold]

I am trying to get a grasp as to which jQuery table sorting method/plugin is better. Tablesorter Parses all the table data to sortable data. Stupid Table Plugin Allows the dev to add sortable ...
0
votes
0answers
15 views

Conway's Game of Life-JavaScript [on hold]

I cannot figure out how to move to the next generation or if my "rules" even make sense or work. I have the neighbors declared and working. I do not know where to go from here or how to do it. I ...
3
votes
1answer
41 views

Simple AJAX script calling a number

I wanted to create a basic interaction which does 1 outcome but with 2 possible actions: get a number from an other document, by either clicking on a button or waiting a fixed amount of time. I wrote ...
0
votes
0answers
6 views

Retrieve and cache web SPI results, then display on page

I'm writing some code to return results from a web service and display them on screen. If the service is down I want to use Lawnchair to serve cached results. ...
4
votes
1answer
28 views

Handler for a screencast submission form

I have a monolithic script that powers this form: Here it is: ...
2
votes
1answer
10 views

Making a selection in a dropdown based on several possible values

I'm making a Chrome extension that lets you choose a size of an item and check out quickly. I have a value called "Large" in sizePref array in my chrome.storage. ...
5
votes
1answer
48 views

Simple syntax highlighter - part 2

I've completely revamped my old syntax highlighter, and made it more flexible and easy to use. It works the same way as the previous one, wrapping <span> ...
3
votes
0answers
53 views

jQuery selector function in JavaScript

I've reproduced the jQuery selector function in JavaScript. Here are the two rules that come with this function: You may not use any JavaScript libraries. ...
1
vote
0answers
27 views

jQuery mobile application listing beers and breweries

I have been working on a jQuery Mobile (1.4.5) application for the past week. In short, the application is a bunch of pages that show listings of beers, breweries, and other things. There are few ...
0
votes
1answer
47 views

Auto generate text input and checkboxes when value of text input changes

In these fiddles I am generating the number of textboxes and checkboxes depending on the input of user. This first fiddle deals with the first problem generate number of textboxes onchange of the ...
2
votes
2answers
35 views

Countdown to multiple update times each day

I'm creating an update function to show my users when the next update will be available. I'm using the jQuery countdown plugin to show the time. What is a more efficient way to write this? ...
1
vote
0answers
11 views
3
votes
1answer
52 views

jQuery Accordion

I have some JS that I am not OK with. How can I reduce the amount of code? ...
7
votes
1answer
214 views

Simple syntax highlighter

I've made a simple in-browser syntax highlighter using JQuery. It's pretty simple, it just wraps keywords, integers, and such in <span> elements with color ...
1
vote
1answer
67 views

Improving code for my post handler

I'm currently using this pattern in my JavaScript code. Somewhere in my code I use Dnianas.Post.init. init fires and it will ...
2
votes
2answers
73 views

Should I use module pattern for this notification controller?

I have the following code, I use this pattern for the entire JavaScript code. I'm trying to re-factor my code again. Should I use the Module pattern? Revealing Module Pattern to be specific? What's ...
3
votes
1answer
46 views

Handling a double click issue

I've been doing a lot of form submission using Ajax now and being used to it than having a normal submission. What's been troubling me is that I always ran with a double submission issue when the user ...
5
votes
1answer
46 views

Detecting gyroscope data using promises

In a plugin that I am currently authoring, I am using a function to check whether the device provides gyroscopic data. Although intuitively this can be easily resolved by checking the value of ...
-2
votes
2answers
37 views

How can I rewrite this code to a native JS for() loop? [closed]

I need to ditch each() in favour of a native for() loop. How would I accomplish this task for the code below? ...
2
votes
3answers
128 views

Loading visible images

I am using this code to get images to load only if they are visible. However, it seems to be slow with thousands of images, even if they are not rendered. ...
1
vote
1answer
18 views

Overriding scrolling behavior for navigation elements

I am new to JavaScript, and trying to ensure the i write the best possible code instead of "copy & paste". I hope i am asking correctly, want to know if my code I have written is done correctly ...
2
votes
1answer
29 views

Checking to see if value is in datalist or not

I have a form that is used for inputting data, one of the fields is a datalist with around 6000 options in it, I needed to check that the value entered in to the ...
1
vote
0answers
28 views

Is there a better way to change a div that contains a view link?

I've written some code to load a section of my application between views. While my code works, I'm wondering if there is a better way to do it. (partial views perhaps?) Currently I load the views, ...
0
votes
0answers
9 views

Execute GeoDjango query from multiple rows of data and read it using AJAX

For now this is my code, I used AJAX to read the result of my query. ...
1
vote
1answer
40 views

jQuery function suffers poor performance on multiple uses

I have a bit of jQuery that does one thing on mobile, and a different thing on desktop. On mobile it toggles a class on a div that shares a common class with the link, on desktop it does the same, ...
-4
votes
1answer
36 views

iframe HTML element unwrap

This function is used for <iframe> HTML element unwrapping. Most of the lines are repeated. How can I simplify this function? ...
2
votes
1answer
35 views

Disabling buttons on forms

I have 5 different forms where I am disabling the submit button when a valid form is submitted so the form can only be submitted once. I am using a hidden field on each form to get the form Id. ...
0
votes
1answer
31 views

Underscore.js and jQuery templating

I want to improve my code or structure. How does it look? Any comments or suggestions? ...
1
vote
0answers
28 views

Setting fixed height panes based on window's width

I have a webapp that follows responsive design and has following layout structure. The left layout appears when the window's width > 768px and right layout shows ...
3
votes
1answer
41 views

Creating a menu as nested unordered lists from JSON data

I have a JSON input using which I have written below function to recursively create an unordered list. Is there more precise way to achieve it? ...
3
votes
1answer
77 views

Shortest and most efficient way for an endless image/content rotation in Vanilla JS and jQuery

I wanted to create the most shortest JavaScript code for an endless rotation of elements, without any controls. The elements can be images or SVG-elements (only the Vanilla JS version will work here) ...
1
vote
3answers
71 views

Select multiple rows using multiple data attribute

I am hiding rows for given ids using this code: ...
3
votes
3answers
77 views

Switch questions using JavaScript and CSS

I am writing a Q&A wap page and want to switch questions in one page. This is my first time to write JS and CSS code, so I think there must be some improvement. ...
3
votes
1answer
47 views

Time lag on change function

I have a script to load a range of number. This range of number is only 200 lengths. However, it has a change function. When the start number is change, the the end number will try to find its range ...
0
votes
0answers
39 views

Inline editing for modifying field that requires supplementary inputs (such as password)

I've been using x-editable, but recently needed to perform in-line editing, but required the user to enter one or more additional fields. For instance, to change ...
2
votes
2answers
40 views

Toggling classes on many elements when a button is tapped

I have this very easy functionality to find, toggle and remove classes from my html elements. The thing is that I find my self repeating the same code with just different name classes. I basically ...
0
votes
0answers
28 views

Method for realtime form validation

A quick little method for validating form input with jQuery (and some built in bootstrap classes). I know the regex isn't perfect but it's close enough. Thoughts? ...
1
vote
1answer
32 views

Better Meteor jquery-ui slider integration

I'm struggling to integrate jquery-ui slider widget into my meteor app. The idea is to have slider value in mongo collection and the slider needs to be reactive (automatically synced between clients). ...
2
votes
1answer
25 views

Toggling a panel and the clicker text

I have written some jQuery that slides open a panel on click, and changes the toggles of the clickable bit from 'Show All' to 'Hide All'. It works, but I'm trying to figure out what would be the most ...
3
votes
2answers
62 views

Parsing a URL from a document and matching it from an array

I need help in improving this script that I have written to parse a URL and check it from an array. This is what I have done till now: (fiddle) This is working fine. Was this done correctly? What ...