background preloader

Badass JavaScript

Badass JavaScript

Sylvester - Vector and Matrix math for JavaScript Nouvelle Vague by ultranoir 10 Steps to Getting Started with jQuery Mobile - Waterfox jQuery Mobile | 10 Easy Steps to Getting Started! Demo As smartphones and tablets are become popular and can be found all over the place today, the need for mobile page is rises greatly. A mobile web page provides completely different web experience than a normal web page in term of resolution size, web page load time and mobile browsers. However, we can easily create a mobile page with help of jQuery Mobile framework. jQuery Mobile is a touch-optimized web framework for smartphones and tablets built on jQuery core. Also be sure to let me know in the comments if I have missed out on anything. 1. It’s pretty easy to get started with jQuery Mobile. The data- attributes are HTML5 attributes which are used throughout jQuery Mobile to transform the markup into mobile widget. 2. You can create many ‘pages’ within a single HTML document by stacking multiple divs with a data-role of “page”. 3. In some cases, not all content are static and you might need to have some dynamic content. 4. 5. 6. 7.

Understanding JavaScript’s this keyword | JavaScript, JavaScript (In Portugese) The JavaScript this keyword is ubiquitous yet misconceptions abound. What you need to know Every execution context has an associated ThisBinding whose lifespan is equal to that of the execution context and whose value is constant. 1. 2. a) Invoke as a methodthis is the baseValue of the property reference b) Invoke as baseless function callthis is the global object (or undefined in strict mode) The same applies to self invoking functions: c) Invoke using Function.prototype.callthisis passed by argument d) Invoke using Function.prototype.applythis is passed by argument e) Invoke a constructor using newthis is the newly created object 3. What you might want to know This section explores the process by which this gets its value in the functional context – using ECMA-262 version 5.1 as a reference. Lets start with the ECMAScript definition of this: The this keyword evaluates to the value of the ThisBinding of the current execution context. from ECMA 5.1, 11.1.1 How is ThisBinding set? 1.

35 top examples of JavaScript | JavaScript JavaScript creates platforms that can engage a user and ensure that they remember your site and continue to revisit. It can be used to create games, APIs, scrolling abilities and much more. The internet is full of web design inspiration, including great examples of JavaScript being used to bring a website to life and provide great user experiences. Here we pick some of our favourite examples of JavaScript in action for your inspiration. 01. If you've ever watched Cosmos, you may remember Carl Sagan talking about the Cosmic Calendar. 14 billion years of events is a huge dataset, and displaying it in a browser is no easy task. The son of a historian, Stauber created Histography as a student at Bezalel Academy of Arts and Design, under the guidance of Ronel Mor. The site scans and indexes events from Wikipedia, grabs the article, and pulls in a Google image and YouTube video. 02. 03. For this website about the history of the St. 04. 05. 06. 07. 08. tota11y 09. 10. 11.

Fantastic Micro-Frameworks and Micro-Libraries for Fun and Profit! - Waterfox evercookie - virtually irrevocable persistent cookies samy's home page || follow my twitter || email me || samy kamkar October 11, 2010: Reported on the front page of the New York Times Find the latest details, code, and implementations on github @ Cookie found: uid = currently not set Click to create an evercookie. evercookie is written in JavaScript and contains portions in Java, SWF/ActionScript (Flash) and C# (Silverlight). What is the point of evercookie? csshack, best website ever See CONTACT. Questions or comments, email me: code@samy.pl.

stringify - JavaScript The JSON.stringify() method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. Syntax JSON.stringify([, [, ]]) Parameters value The value to convert to a JSON string. replacer Optional A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting the properties of the value object to be included in the JSON string. space Optional A String or Number object that's used to insert white space into the output JSON string for readability purposes. Description JSON.stringify() converts a value to JSON notation representing it: Properties of non-array objects are not guaranteed to be stringified in any particular order. The replacer parameter The replacer parameter can be either a function or an array. Example with a function Example with an array The space argument See also

jQuery Howto - Waterfox Google Closure: How not to write JavaScript At the Edge of the Web conference in Perth last week I got to catch up with Dmitry Baranovskiy, the creator of the Raphaël and gRaphaël JavaScript libraries. Perhaps the most important thing these libraries do is make sophisticated vector graphics possible in Internet Explorer, where JavaScript performance is relatively poor. Dmitry, therefore, has little patience for poorly-written JavaScript like the code he found in Google’s just-released Closure Library. Having delivered a talk on how to write your own JavaScript library (detailed notes) at the conference, Dmitry shared his thoughts on the new library over breakfast the next morning. “Just what the world needs—another sucky JavaScript library,” he said. When I asked him what made it ‘sucky’, he elaborated. For the rest of the day, to anyone who would listen, Dmitry cited example after example of the terrible code he had found when he went digging through Closure. “I’ll make you a deal,” I told him. The Slow Loop return ! return !

A Javascript When Function Mon Feb 20 2012 function when(conditionFunc, execFunc, interval){ if (conditionFunc()){ execFunc(); }else{ setTimeout(function(){ when(conditionFunc, execFunc, interval);}, interval); } } You have some code which should only execute when a condition is true. E.g. Use when like this... function libIsReady(){ return typeof(LIBRARYNAME) ! Categories

What is HTML5? / HTML & CSS / Textile / Programming languages / Articles / Home - BASICuse - the home of the best guides and tutorials for every day - Waterfox This article belongs to the category "for beginners". Using simple words, we are going to talk about the fifth version of HTML, which is currently under development. And despite the fact that HTML5 is still far from perfect, its performance astonishes many. As you may know, HTML (HyperText Markup Language) - is a language for web page markup. First, let's analyze the differences between the fifth and fourth version. So, the first thing, a fact worth noticing - HTML4 development was fully completed in the late 90's, whereas work on HTML5 started relatively recently - around the year 2005. For example, these new HTML5 elements are currently at your service: section, nav, header, article and footer. Since the main focus was to avoid conflicts between HTML5 and outdated browser engines, new version is provided with the option to completely ignore new mapping rules defined in HTML5. Now let's focus on the structure and markup language in HTML5.

A JavaScript Module Pattern Eric Miraglia (@miraglia) is an engineering manager for the YUI project at Yahoo. Eric has been at Yahoo since 2003, working on projects ranging from Yahoo Sports to YUI. For the past several years, Eric and his colleagues on the YUI team have worked to establish YUI as the foundation for Yahoo’s frontend engineering work while open-sourcing the project and sharing it with the world under a liberal BSD license. Eric is an editor and frequent contributor to YUIBlog; his personal blog is at ericmiraglia.com. Prior to working at Yahoo, Eric taught writing at Stanford and elsewhere and led frontend engineering teams at several startups. Global variables are evil. Douglas Crockford has been teaching a useful singleton pattern for achieving this discipline, and I thought his pattern might be of interest to those of you building on top of YUI. 1. YAHOO.namespace("myProject"); This assigns an empty object myProject as a member of YAHOO (but doesn’t overwrite myProject if it already exists). 2.

Related: