Chosen - a JavaScript plugin for jQuery and Prototype - makes select boxes better. Chosen is a jQuery plugin that makes long, unwieldy select boxes much more user-friendly. Downloads Project Source Contribute Standard Select Turns This Into This Multiple Select <optgroup> Support Single Select with Groups Multiple Select with Groups Selected and Disabled Support Chosen automatically highlights selected options and removes disabled options. Single Select Multiple Select Hide Search on Single Select The disable_search_threshold option can be specified to hide the search input on single selects if there are n or fewer options.
Default Text Support Chosen automatically sets the default field text ("Choose a country... ") by reading the select element's data-placeholder value. Note: on single selects, the first element is assumed to be selected by the browser. No Results Text Support Setting the "No results" search text is as easy as passing an option when you create Chosen: Limit Selected Options in Multiselect You can easily limit how many options the user can select: Right-to-Left Support. JavaScript Study Guide. A few months ago, I wrote about learning JavaScript. I'm already pretty comfortable with the language, and although I did break the chain, I'm happy to report that I'm still at it.
Never stop learning, right? In case it's helpful to others, I thought I'd mention a few more resources. I may even keep this list updated. Eloquent JavaScript This is the interactive tutorial I mentioned in my original post. JavaScript: The Good Parts This is the book I mentioned in my original post. JavaScript for PHP Developers Very fortuitously, I was asked to review a new book by Stoyan Stefanov shortly after I began learning JavaScript. PHP Functions in JS This is a fantastic list of PHP functions implemented in JavaScript. JavaScript Patterns Several people have recommended that I read this book, also by Stoyan Stefanov. 3 Ways to Define a JavaScript Class After I learned there are no classes in JavaScript, I found this great post by Stoyan explaining the issue in great detail.
Learn JavaScript JavaScript Garden. Using Mixpanel to log client side errors (javascript) - n3rds.com Blog. jPlayer : HTML5 Audio & Video for jQuery. 7 Resources Every JavaScript Developer Should Know | Accidental Technologist. A web developer today is expected to be an expert in every aspect of their craft and JavaScript is no exception. Years ago JavaScript seemed to be more of an annoyance, producing those trailers at the bottom of the browser. This has changed and JavaScript is a first-class citizen as a functional programming language and what seems like an unlimited number of resources covering the language. I have been doing more and more JavaScript lately, both on the front-end and some node.js on the back end. I wanted to share some great resources I use for what’s new with regards to JavaScript libraries, projects and general reference. 1.
I am a fan of listening to good podcasts when I take a daily hike. This podcast is put together by the same creator of Ruby Rogues, another great podcast but instead talking about Ruby. Each episode covers a particular topic and goes into detail about the pros and cons of using the technology. 2. 3. This is a weekly newsletter put out by Peter Cooper. 4. 5. 6. 7. The Basics of jQuery ↩ Andrée. So, a while back I had an internal presentation at work about this topic. A few good friends in the community took a look at my slides, and they thought it would make a nice blog post because “there can’t be too many good posts about jQuery introduction and best-practices.” Whether this post is going to be good or not, is up to you but I’ll try to outline what jQuery is, and how you can start working with it.
For most of you, this will just be a re-cap and probably not provide much new information but can perhaps serve as a reference post if you ever need one. I will expect some basic knowledge about JavaScript but you do not have to be an expert, heck, you don’t even need to have used jQuery before—but you should know terms like object literals, anonymous functions, and what DOM and CSS are. What is jQuery? jQuery is a client-side JavaScript library that abstracts away browsers’ different implementations into an easy-to-use API. How do I use jQuery? Using selectors and instance methods. Weixiyen/messenger.js - GitHub. 10 Coding Tips to Write Superior jQuery Plugins. Through the process of writing many jQuery plugins I have come to a point where I follow a pretty standard structure and design pattern when developing my plugins. It for one greatly speeds up my development time as it’s just one part of the equation I don’t need to think about and can just copy and paste.
I already know how things will be structured and will work for the most part so I can focus on just building out the main code. Following a consistent design pattern and structure also helps when fixing bugs or building on top of a plugin. Having a structure that has proved to stand well in my other plugins means I won’t have to rehash my code to account for new details. I know it can hold well with small plugins as well as larger ones. I wanted to share this set of coding tips that I follow and generally from what I can tell are pretty consistent among the more popular plugins out there. Keep All Your Code in a Closure Provide and Extend Default Options Always Return the Element. Minimit Gallery Plugin. Function.apply and Function.call in JavaScript. In order to explain how the createDelegate function works in the last post, we have to understand JavaScript closures and Function.apply().
The apply() method is the easiest subject to tackle, so we'll start there and work up. Every function in JavaScript has a number of attached methods, including toString(), call(), and apply(). If it sounds odd to you that a function might have its own methods - then remember that every function in JavaScript is an object. Read this article for a refresher. You might also wonder what the difference is between a function and a method. I believe the descriptors 'function' and 'method' are just a JavaScript convention. Because functions are objects they can have their own properties and methods, and we can treat them like data. Let's start with the following code: Here we have a global function by the name of f(). f() uses the this keyword to reference x, but notice we don't invoke the function through an instance of an object.
jQuery Multiple File Upload Plugin v1.47 (2010-03-26) What this is This jQuery Multiple File Upload Plugin ($.MultiFile) is a non-obstrusive plugin for jQuery that helps users easily select multiple files for upload quickly and easily on your server whilst also providing some basic validation functionality to help developers idenfity simple errors, without having to submit the form (ie.: upload files). What this isn't This plugin will not create a dialog that allows the user to select multiple files at once. That simply cannot be done via javascript. If that's what you need, you should consider using HTML5's multiple="multiple" attribute or one of the many other flash based file upload solutions (eg.: SWFupload, uploadify and others) How it works The plugin creates a new file input element every time the user select a file, which allows the user to select a file, then another, then another, then another and so on... selecting as many files is required, one at a time.
How do I use it? This implementation does not require any jQuery experience.