|
Blog, Projects, and Links "John Resig"的最新文章 I was playing around with DOM DocumentFragments recently, in JavaScript, seeing what I could make with them. Roughly speaking, a DocumentFragment is a lightweight container that can hold DOM nodes. It's part of the DOM 1 specification and is supported in all modern browsers (it was added to Internet Explorer in version 6).
In reading up on them I came across an interesting point, from the specification: Furthermore, various operations -- such as inserting nodes as children of another Node -- may take DocumentFragment objects as arguments; this results in all the child nodes of the DocumentFragment being moved to the child list of this node. This means that if you take a bunch of DOM nodes and append them to a fragment th...... (查看原文)
2008-07-21 08:16 I've got a mini-announcement. Starting this week about half of my time at Mozilla is going to be spent driving the direction of the brand-new Mozilla Firebug team. I'm, understandably, quite excited about this proposition. Like all web developers I've found Firebug to be an invaluable tool for web development.
We have a great team forming - I'm going to be joined by: * Jan Odvarko - Long-time Firebug hacker. * Rob Campbell - Mozilla hacker, tester, and tool developer. (His announcement post) We're in a very primordial stage right now - we're meeting at the Firefox Summit at the end of the month and again at the beginning of August for...... (查看原文)
2008-07-17 15:53 I've had a little utility that I've been kicking around for some time now that I've found to be quite useful in my JavaScript application-building endeavors. It's a super-simple templating function that is fast, caches quickly, and is easy to use. I have a couple tricks that I use to make it real fun to mess with.
Here's the source code to the templating function (a more-refined version of this code will be in my upcoming book Secrets of the JavaScript Ninja): // Simple JavaScript Templating // John Resig - http://ejohn.org/ - MIT Licensed (function(){ ...... (查看原文)
2008-07-16 23:06 A new feature being introduced in HTML 5 is the addition of custom data attributes. This is a, seemingly, bizarre addition to the specification - but actually provides a number of useful benefits.
Simply, the specification for custom data attributes states that any attribute that starts with "data-" will be treated as a storage area for private data (private in the sense that the end user can't see it - it doesn't affect layout or presentation). This allows you to write valid HTML markup (passing an HTML 5 validator) while, simultaneously, embedding data within your page. A quick example: <li class="user" data-name="John Resig" data-city="Boston" data-lang="js" data-food="Bac...... (查看原文)
2008-07-13 08:36 This week I've been busy working on implementing a test suite for the Selectors API specification. I picked up a new microphone recently so I decided to do a quick walkthrough of the work that I've been doing and how I've been going about it. You can view the the video below:
Implementing a Selectors API Test Suite You can run the test suite for yourself here (it's still very much in flux - there are various parts that may still be wrong): http://ejohn.org/apps/selectortest/ Here's a quick break down of a test run that was done earlier: ...... (查看原文)
2008-07-11 00:43 |
发现更多精彩的Blog · · · · · ·谁上这个blog? |