background preloader


Facebook Twitter

10 Small Things You May Not Know About Javascript. It doesn’t matter how many years I’ve been dealing with Javascript – it contains many little things that surprises me almost every week.

10 Small Things You May Not Know About Javascript

For me, Javascript means a constant learning process. In this article, I’ll provide ten small Javascript tips, mainly aimed for beginner and intermediate Javascript developers. Hopefully there’s at least one useful tip for every reader :). 1. Variables conversions This sounds quite obvious, but as far I’ve seen, using object constructors, like Array() or Number() for converting variables is quite common practice. Var myVar = "3.14159", str = ""+ myVar, int = ~~myVar, float = 1*myVar, bool = !! Var myVar = "3.14159", str = ""+ myVar,// to string int = ~~myVar, // to integer float = 1*myVar, // to float bool = !! DropKick - a jQuery plugin for beautiful dropdowns. .dk_theme_black { background : #aebcbf ; background : - moz - linear - gradient ( top ,

Javascript PC Emulator. jQuery Shadow Plugin. Useful Coding Tools and JavaScript Libraries For Web Developers - Smashing Magazine. Advertisement Everyone who is a regular Smashing Magazine reader will know that we have a traditional habit of regularly researching the latest resources, tools and services out there on the Web, as productivity is a crucial asset of professional Web designers and developers.

Useful Coding Tools and JavaScript Libraries For Web Developers - Smashing Magazine

We could, and should, all integrate workflow optimization into our working practices. Perhaps we should warn you upfront for the long compilation, but what can we say — there are so many excellent tools out there which deserve attention of the community, yet unfortunately remain obscure way too often. We love all the designers and developers out there for releasing and producing useful, valuable resources for all of us to use! We, for one, surely sincerely appreciate it in the name of the Web design community. Useful Coding and Workflow Tools Stripe: Easy Credit-Card Processing For Online StoresA website owner has many options for accepting credit card payments. Last Click Stay Tuned! You won’t regret it. jQuery Sliding Clock v1.1. Flexigrid. Presentation tool based on the power of CSS3 transforms and transitions in modern browsers.

Aren't you just bored with all those slides-based presentations?

presentation tool based on the power of CSS3 transforms and transitions in modern browsers

Don't you think that presentations given in modern browsers shouldn't copy the limits of 'classic' slide decks? Would you like to impress your audience with stunning visualization of your talk? Then you should try It's a presentation tool inspired by the idea behind and based on the power of CSS3 transforms and transitions in modern browsers. visualize your big thoughts by positioning, rotating and scaling them on an infinite canvas. Logging with JavaScript. I am sure this has been done a thousand times, I'm posting because I found a really old posting I wrote on the subject.

Logging with JavaScript

So anyway, for posterity's sake, I'm copying here. It should be pretty clear what this does. Basically, we are appending the log message as a query string parameter and making the browser request it as an image. The images are stored in an array because objects in the function will lose scope when the function ends. This could prevent some requests from being made. You should probably have something to receive the request (one pixel gif maybe), just to prevent filling the log with 404 errors. Just for kicks, here is a version that doesn't use the global variable for the image array.

This works due to the fact that functions are objects in javascript. A word about caching, if there is an expectation that the same messages be logged for a user, consider adding a random number to the end on the query string. jQuery Slideshow & Content Slider Plugin For Wordpress. JavaScript log servlet. JavaScript $N Multistroke Recognizer. Download $N Recognizer: JavaScript, C# Pseudocode: $N, $N-Protractor Multistroke gesture logs: xml About The $N Multistroke Recognizer is a 2-D stroke recognizer designed for rapid prototyping of gesture-based user interfaces.

JavaScript $N Multistroke Recognizer

In machine learning terms, $N is an instance-based nearest-neighbor classifier with a Euclidean scoring function, i.e., a geometric template matcher. $N is built upon the $1 Unistroke Recognizer. Demo In the demo below, only one multistroke template is loaded for each of the 16 gesture types. JavaScript Style Attributes. Listed below are the tables of CSS properties for various HTML element style attributes.

JavaScript Style Attributes

I have added a column indicating the javaScript name that the browser recognizes for these properties. I have only listed those that I know work, but the trend seems to be to use the same name when one name is the style descriptor. When there are two names, use the first name in lower case and the first character of the second name in upper case. Are you ready for this. Filed: Thu, Oct 11 2007 under Programming|| Tags: DOM onlaod onready ondomready ready functional For small pages, the preferred method of starting up your scripts is to use the window.onload event.

Are you ready for this

This is a perfectly great little event which will fire after the page has finished loading and call whatever function you've assigned to it. For instance the following code will run as soon as the page has finished loading. <script> function startup() { alert("The page has finished loading! I'm ready to do stuff! ") Here we create a startup function that simply issues an alert box, we then pass window.onload the pointer to the function. Scaling onload The problem with the above script is that it assumes that no other script or library will want to attach an onload event of its own. The solution here is to create a registration function that allows you to register events.

This is actually pretty sophisticated javascript and a great example of functional programming.