Javascript

Facebook Twitter

jTypes. Classes Classes help organize applications and libraries by promoting the reuse of code and facilitating the ease of maintainence.

jTypes

They are created by providing the jTypes compiler with a definitions object in the following format: How do I compile a jTypes class? jTypes([String modifiers,] [Class base,] [Function constructor,] Object definitions) This definitions object is a template for creating instance objects. If an instance of the Color class is instantiated, the fields will have their default primitive values. The modifiers argument of the jTypes compiler accepts a space-separated string of keywords. Constraints Type constraints restrict values to simplify the implementation and maintainence of classes.

7 Things You Need To Know About Web Workers. Introduction Web Workers allow you to run JavaScript code in the background without blocking the web page user interface.

7 Things You Need To Know About Web Workers

You Might Not Need jQuery. Airbnb/javascript. Choir.io. Manuelbieh/Geolib. Writing Fast, Memory-Efficient JavaScript. Advertisement JavaScript engines such as Google’s V81 (Chrome, Node) are specifically designed for the fast execution2 of large JavaScript applications.

Writing Fast, Memory-Efficient JavaScript

As you develop, if you care about memory usage and performance, you should be aware of some of what’s going on in your user’s browser’s JavaScript engine behind the scenes. You should, however, ask yourself questions such as: Is there anything I could be doing more efficiently in my code? What (common) optimizations do popular JavaScript engines make? Fast-loading Web sites — like fast cars — require the use specialized tools. Learning JavaScript Design Patterns.

Don't Initialize All the Things in jQuery.ready() One of the first impressions a user gets is loading your web application for the first time.

Don't Initialize All the Things in jQuery.ready()

Users don't have a high tolerance when it comes to page speed. They want to see something almost immediately and then be able to start interacting with your web site shortly after. If your website utilizes JavaScript and jQuery, which many web sites do, it is very tempting to pre-initialize all of your logic (plugins, widgets, modules, event handlers, etc) in order for them to respond as fast as possible. Unfortunately, initializing ALL THE THINGS during page load works against the user's goal of loading quickly. Instead of initializing everything when the page is ready you can instead wait to initialize portions of your application until they are needed. Best Free JavaScript Chat Clients for Your Website. Upvote your favorite resources to improve the accuracy of the ranking :) 1) Highly Customizable Multi-User Chat Client in Javascript Candy is a JavaScript-based multi-user chat client. Clipping JPEG Images Into Non-Rectangular Polygons Using polyClip.js.

This photo is not a PNG image with an alpha channel.

Clipping JPEG Images Into Non-Rectangular Polygons Using polyClip.js

There have been many times I have come across the need to take an image and cut an irregular shape out of it. Normally, when a developer comes across this requirement, the only thing to do is to open the image up with your favorite graphics editor, use the select tool to cut out the shape you want, and then save the result as a PNG, since it is the only image format used by all web browsers that support alpha channels. The problem is that PNG images, while compressed, are not as small as JPEGs if the source image is a photograph, and the download time of a page can balloon to unacceptable levels if there are many of these types of image on a page. When I first came across this problem, I didn’t think there was an obvious solution, but after a lot of thought, I created a library that uses HTML5 canvas to clip a JPEG (or any other image for that matter). The trip of a lifetime. Byte-saving Techniques - GitHub. Learning Advanced JavaScript.

5 Lesser Known JavaScript Libraries that Make Web Design Easier. In this round-up we'll be looking at 5 JavaScript libraries that can really ease the development of modern, attractive web sites.

5 Lesser Known JavaScript Libraries that Make Web Design Easier

The libraries that we'll be looking at aren't libraries in the same sense as something like jQuery or the YUI; they're much smaller and much more specialized. But they're the best at what they do and provide unique functionality. 1. Fixing PNGs in IE6 with DD_BelatedPNG Created by: Drew DillerLicense: MIT Usage: Fixes alpha-transparent PNGs in IE6Size: 6.86kb (compressed)Compatibility: IE6 onlyView DemoDownload DD_belatedPNG was created for the single purpose of allowing alpha-transparent PNGs to be used in IE6 without resorting to Microsoft's proprietary AlphaImageLoader filter. Using the AlphaImageLoader filter only fixes half of the PNG problem in IE6 as it can only be used with background images. Lines go all over the place.

Edge.js (javascript image mask effect) <form name="lst" id="lst" method="post" action=".. edge.js 1.5 allows you to add individual masks (inc. inbuilt mask) to images on your webpages.

edge.js (javascript image mask effect)

It uses unobtrusive javascript to keep your code clean. It works in all the major browsers - Mozilla Firefox 1.5+, Opera 9+, Safari and IE6+. On older browsers, it'll degrade and your visitors won't notice a thing.CVI-lab: Get a fast impression of the effects and their illustration qualities. Shows some of the things edge.js does. First 5 images with class = "edges imaskN" the two other images with class = "edges inbuilt"...