background preloader

Javascript

Facebook Twitter

9 JavaScript Libraries for Working with Local Storage. The HTML5 Local Storage API (part of Web Storage) has excellent browser support and is being used in more and more applications.

9 JavaScript Libraries for Working with Local Storage

It has a simple API and certainly has its drawbacks, similar to cookies. Over the past year or so I’ve come across quite a few tools and libraries that use the localStorage API so I’ve compiled many of them together into this post with some code examples and discussion of the features. Dialog Widget. Description: Open content in an interactive overlay.

Dialog Widget

A dialog is a floating window that contains a title bar and a content area. The dialog window can be moved, resized and closed with the 'x' icon by default. If the content length exceeds the maximum height, a scrollbar will automatically appear. A bottom button bar and semi-transparent modal overlay layer are common options that can be added. Bulk Upload in AngularJS. Download source - 3.7 MB Introduction While working with SPA (Single Page Application) using AngularJS in my project, I needed bulk upload to be implemented.

Bulk Upload in AngularJS

I was stuck for some time and finally achieved this. Knockout : Home. Introduction to KnockoutJS. Introduction Knockout, developed by Steve Sanderson, is free open source JavaScript library available under MIT license.

Introduction to KnockoutJS

It was first released in 2010 and since its initial release it has caught attention of industry and has been very popular. It is written purely in JavaScript and works on any web platform, any web browser and has no other dependencies. A simple modal feedback form with no plugins < JavaScript. 1 Tweet5 Shares1 ShareFeedback Almost every website these days has some kind of comment or feedback form.

A simple modal feedback form with no plugins < JavaScript

Often they rely on Facebook, Disqus or other third-party services, or require bloated libraries such as jQuery to function. Here you can find instructions for setting up a very basic feedback form using just a few lines of CSS and JavaScript. The form will appear in a modal (popup) with the background greyed out. 1.

Modal

Create a Modal Dialog Using CSS and Javascript. Back in my early programming days, before I switched over to web development, I spent most of my time writing software for Windows.

Create a Modal Dialog Using CSS and Javascript

I look back on that time with fond memories. 8-bit icons, OLE2, and no silly Start menus. With the recent Web 2.0 boom, many web developers have returned to their roots and begun building sites that resemble desktop applications. AJAX (the second coming of javascript) lets designers borrow elements from the desktop paradigm and use them on their websites. One element that I find myself using quite a bit are modal dialogs. In a desktop application, a modal dialog is a box or message that forces you to dismiss it before you can use any other part of the program. Http-server. A simple zero-configuration command-line http server http-server is a simple, zero-configuration command-line http server.

http-server

It is powerful enough for production usage, but it's simple and hackable enough to be used for testing, local development, and learning. Localizing Times in JavaScript. Say you have a time you'd like to display on your site.

Localizing Times in JavaScript

You've entered it in your time zone. You can always be specific and say something like: 3:00 PM Eastern Standard Time. Using the Media Capture API in the Browser. Today I’d like to experiment with the Media Capture and Streams API, developed jointly at the W3C by the Web Real-Time Communications Working Group and the Device APIs Working Group.

Using the Media Capture API in the Browser

Some developers may know it simply as getUserMedia, which is the main interface that allows webpages to access media capture devices such as webcams and microphones. You can find the source code for this project on my GitHub. Additionally, here’s a working demo for you to experiment with.

Angular

Understanding Angular's $apply() and $digest() $apply() and $digest() are two core, and sometimes confusing, aspects of AngularJS.

Understanding Angular's $apply() and $digest()

To understand how AngularJS works one needs to fully understand how $apply() and $digest() work. This article aims to explain what $apply() and $digest() really are, and how they can be useful in your day-to-day AngularJS programming. Tryit Editor v2.5. AngularJS: API: ngRepeat. The ngRepeat directive instantiates a template once per item from a collection. Each template instance gets its own scope, where the given loop variable is set to the current collection item, and $index is set to the item index or key. Special properties are exposed on the local scope of each template instance, including: AngularJS: API: date. 7 Essential JavaScript Functions. I remember the early days of JavaScript where you needed a simple function for just about everything because the browser vendors implemented features differently, and not just edge features, basic features, like addEventListener and attachEvent. Times have changed but there are still a few functions each developer should have in their arsenal, for performance for functional ease purposes. debounce The debounce function can be a game-changer when it comes to event-fueled performance.

What is the best auto-suggest search algorithm for javascript. Algorithm - Getting the closest string match. Live Search with Quicksilver Style. Agershun/alasql. CodeMontage. Login Projects These open source, community-driven projects are making the world better and could really use your help. Check them out and contribute however you'd like. Or, view organizations. Excited to contribute, but can't dig in right now? Promise. The Promise object is used for asynchronous computations. A Promise represents a value which may be available now, or in the future, or never. SyntaxEdit. Map/reduce queries. Map/reduce queries, also known as secondary indexes, are one of the most powerful features in PouchDB.

However, they can be quite tricky to use, so this guide is designed to dispell some of the mysteries around them. Many developers make the mistake of using the query() API when the more performant allDocs() API, would be a better fit. Before you solve a problem with secondary indexes, you should ask yourself: can I solve this with the primary index (_id) instead? Mappin' and reducin' The PouchDB query() API (which corresponds to the _view API in CouchDB) has two modes: temporary queries and persistent queries.