background preloader

Javascript

Facebook Twitter

jTypes. Classes Classes help organize applications and libraries by promoting the reuse of code and facilitating the ease of maintainence. 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.

It provides initial primitive values for fields, and function references for methods and properties. 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. Array Class date element (2.2.1) error function jquery (2.2.1) object primitive regexp type window Primitive Constraints boolean (bool) integer (int) number (float) string symbol Struct. 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.

Web workers can improve the overall performance of a web page and also enhance the user experience. Web workers come in two flavors - dedicated web workers and shared web workers. This article discusses seven key aspects of web workers that you need to know if you decide to use them in your applications. 1. Typically the JavaScript code that you write in a web page executes in the same thread as the user interface. Web workers can't access DOM elements from the web page.Web workers can't access global variables and JavaScript functions from the web page.Web workers can't call alert() or confirm() functions.Objects such as window, document and parent can't be accessed inside the web worker. 2.

Web workers come in two types: dedicated web workers and shared web workers. In many cases, dedicated web workers fulfill your needs. 3. <! 4. 5. 6. 7. Summary. 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. 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. There are many common pitfalls when it comes to writing memory-efficient and fast code, and in this article we’re going to explore some test-proven approaches for writing code that performs better. So, How Does JavaScript Work In V8? While it’s possible to develop large-scale applications without a thorough understanding of JavaScript engines, any car owner will tell you they’ve looked under the hood at least once. Learning JavaScript Design Patterns. 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.

There are plenty of web-based chat clients out there. Most of them are built to emulate your instant messenger. They offer you tons of settings. Candy is different. Candy focused on real-time multi-user chatting. Requirements: Javascript Framework Demo: License: MIT License 2) Chat Room v2 with PHP, jQuery, and a Text File This is Chat2, which is an update to original Chat Room published on CSS-Tricks. There are some new features in Chat2. Requirements: jQuery Framework Demo: License: License Free 3) Google Talk Chatback- A Real Instant Message Session Do you have a blog, online profile, or some other personal web page?

To use chatback, you must have a Google Talk account, but your visitors don’t have to! 6) Open Source Ajax XHTML Chat. Clipping JPEG Images Into Non-Rectangular Polygons Using polyClip.js. The trip of a lifetime. Byte-saving Techniques - GitHub. Byte-saving Techniques This is a collection of JavaScript wizardry that can shave bytes off of your code. It's mainly intended as a reference for those creating entries for 140byt.es. Feel free to add your own or send any feedback to @140bytes. Disclaimer Outside of the 140bytes challenge or other code golf challenges, please be considerate and don’t pre-minify code you wish to share with others. Arguments Use one-letter positional arguments, in alphabetical order Since arguments will need to be as short as possible, and will likely be reused within their lifetime, it's best to treat them as positionals instead of trying to give them meaning through their name.

Function(t,d,v,i,f){...} // beforefunction(a,b,c,d,e){...} // after Test argument presence instead of length Use in to check whether a given argument was passed arguments.length>1||(cb=alert) // before1 in arguments||(cb=alert) // after If only truthy arguments are of interest, you can even boil that down to Variables Exploit coercion Loops. Learning Advanced JavaScript.

5 Lesser Known JavaScript Libraries that Make Web Design Easier. 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. 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"... Images used are copyrighted and are used for demonstration only. Download edge.js and include it into your webpage.