WebKit gets native getElementsByClassName
WebKit gets native getElementsByClassName
getElementsByClassName has always been a pain in the arse for us developers. Why it wasn’t implemented natively across the board is something that browser folk can chat about. Not having it available has caused hacks, workarounds, and bugs. Firefox and Opera support the beast, and now Webkit has joined them: The advantages of a native implementation are […]
getElementsByClassName has always been a pain in the arse for us developers. Why it wasn’t implemented natively across the board is something that browser folk can chat about. Not having it available has caused hacks, workarounds, and bugs.
Firefox and Opera support the beast, and now Webkit has joined them:
The advantages of a native implementation are clear:
- No additional JavaScript library files required
- Clearly specified and consistent behavior
- Blindingly fast
How fast? Let’s have a look at WebKit’s shiny new implementation. For testing purposes I wrote a simple benchmark allowing comparison between three different methods for getting elements by their class names. The first is the new native getElementsByClassName, and the last two are both from prototype.js; one uses XPath, and the other is a straight JavaScript/DOM implementation.
Untold JavaScript Secrets
John Resig has some JavaScript secrets that he wishes to tell in a new book, and wants your help in getting more. Some on the tip of his tongue are: What is (function(){ })() and why is it so fundamentally important to modern JavaScript development? What does with(){…} do and why is it so useful? How can arguments.callee change […]
John Resig has some JavaScript secrets that he wishes to tell in a new book, and wants your help in getting more.
Some on the tip of his tongue are:
- What is
(function(){ })()and why is it so fundamentally important to modern JavaScript development? - What does
with(){...}do and why is it so useful? - How can
arguments.calleechange how I work with JavaScript code? - How exactly do timers work and how can I best use them?
- How do I identify and tackle memory leaks in web applications?
- How do I write a cross browser way of…
- Getting/setting attributes.
- Injecting HTML strings.
- Getting/setting computed css values.
- Managing DOM events.
- Writing a CSS selector engine.
- Doing smooth animations.
- How can I use verification tools (like JSLint) to my advantage - and write my own?
- What’s the best way to transmit JavaScript files?
- How do I write my own JavaScript compressor (like Packer)?
This looks like good stuff. I am sure the likes of Dean Edwards, Neil Mix, Kris Zyp, Alex Russell, and many others have interesting things to add.
A book that I would love to see is the equivalent of the Eric CSS books for Ajax. Take some real apps and build them in a book. Quality case studies that teach you a lot, in a nice glossy set of copy that makes you smile.
What would you like to see? Maybe the entire piece could be made collaboratively
Packing Down Prototype
In the world of client-side development, page size definitely matters and John-David Dalton is doing his best to improve this. Awhile back, he took on the task of trying to determine how to best optimize the 120k+ Prototype and Script.aculo.us libraries and get the best compression out of the files. He’s done an absolutely fabulous […]
In the world of client-side development, page size definitely matters and John-David Dalton is doing his best to improve this. Awhile back, he took on the task of trying to determine how to best optimize the 120k+ Prototype and Script.aculo.us libraries and get the best compression out of the files. He’s done an absolutely fabulous job in the past and continues to pack the libraries as new versions are released. He’s just released his new version of his compressed Prototype collection and released it on Google Code.
This pack contains the following compressed versions of Prototype: 1.4, 1.5, 1.5.1.1, 1.6.0 and Scriptaculous: 1.7.1_beta3, 1.8.0. This release compresses Prototype and Scriptaculous around 10% more than regular gzipping.
Prototype’s lowest weighs in at 20.4kb.
Scriptaculous’ lowest weighs in at: 19.7kb.
Protoculous’ lowest weighs in at: 38.4kb.
Compressed forms of Scriptaculous are segmented to allow for custom builds of Protoculous/Scriptaculous.
He has included a common custom build with the pack, “Prototype+Effects”, which weighs in at around 26kb. That’s smaller than standard Prototype gzipped!
Protoculous also allows the loading of additional js files like Scriptaculous via: protoculous.js?load=one,two
You can download his collection here and included in the download is a readme file providing more details about his build.
Happy Holidays from SitePoint!
As I write this, most of Team SitePoint is up on the 3rd floor partying down in style. It’s the end of a big year for us, and we’ve got a lot to celebrate … but of course there’s also plenty to look forward to in the year ahead! In 2008, you can expect the following […]
As I write this, most of Team SitePoint is up on the 3rd floor partying down in style. It’s the end of a big year for us, and we’ve got a lot to celebrate … but of course there’s also plenty to look forward to in the year ahead!
In 2008, you can expect the following from SitePoint:
- 99designs
The new incarnation of SitePoint Design Contests that we launched this year has been so successful that we feel it’s time it was set free to make its own way in the world. This active design community will be split off onto its own site and renamed to ‘99designs’.
Of course, this rebranding will come with a whole new visual design for the site. Watch for us to run a contest in the SitePoint Design Contests community to design the 99designs logo!
- The SitePoint Reference
Our CSS Reference site is already in closed beta, and we’re getting loads of great feedback from the SitePoint forum community. Early in 2008, this ‘reference to end all CSS references’ will open its doors to the world, and will be closely followed by references for HTML and JavaScript … each written by some of the foremost authorities on each technology.
- More great books
Our first title for 2008 will be The Art & Science of JavaScript, brought to you by a star-studded team of JavaScript experts.
- …and lots more!
SitePoint HQ is shutting its doors as we all take some time off over the holiday season. We’ve got some great articles queued up to go live while we’re away, and a few of our regular bloggers will no doubt chime in with any breaking news, but otherwise it may be a bit quiet around here for the next week. Rest assured, we’re just saving up some energy for the exciting year ahead!
See you in 2008…
This article provided by sitepoint.com.
Clarke Calls for CSS Working Group to be Disbanded
Having recently announced the CSS Eleven initiative to provide designer feedback and input into the W3C’s CSS Working Group, Andy Clarke has responded to the Opera-Microsoft antitrust action by calling for the Group to be dissolved entirely and rebuilt without browser vendors in a controlling role. He considers this necessary not only […]
Having recently announced the CSS Eleven initiative to provide designer feedback and input into the W3C’s CSS Working Group, Andy Clarke has responded to the Opera-Microsoft antitrust action by calling for the Group to be dissolved entirely and rebuilt without browser vendors in a controlling role.
He considers this necessary not only because he doubts that the representatives of Opera and Microsoft can collaborate on CSS3 while locked in a legal battle, but also because he feels it’s time the future of web standards was led by those of us who will eventually use them in our daily work, not those who hope to make money by making browsers.
Clarke’s indictment of Opera’s legal action has been echoed by many in the web design community. CSS expert Eric Meyer considers the Opera move to be bad timing, coming right when Microsoft was showing promise with IE7 and the upcoming IE8:
It’s the wrong move at the wrong time, sending precisely the wrong signal to Microsoft about the importance of participating in development and support of open standards, and I can only hope that it comes to a quiet and unheralded end.
But few seem to agree with Clarke’s proposal to restructure the CSS Working Group. Many believe the group has life in it yet, while others are calling for the wholesale abandonment of the W3C process.
The voice of reason in all this seems to be Alex Russell of the Dojo Toolkit. In his article, The W3C Cannot Save Us, he explains that what is really holding the Web back is our fanatical devotion to web standards, and the expectation that they can dictate what new features should be added to web browsers.
Put simply, Zeldman is hurting you and only you can make it stop. Neither the CSS WG nor the HTML 5 WG nor, indeed, any W3C working group can define the future. They can only round off the sharp edges once the future becomes the past and that’s all we should ever expect of them. As much as they tell us (and themselves) that they can, and as much as they really would like to, the W3C cannot save us.
Long-time Tech Times readers will not be surprised that I agree with Alex. His opinion is pretty much what I said in the Tech Times #137, way back in April 2006:
In my mind, it shouldn’t be the W3C’s job to develop new standards from scratch, nor should the W3C be responsible for championing new features in individual browsers. Those are the jobs of the innovators and early adopters, who push the boundaries of the possible, producing early implementations that blaze trails for future standards to pave.
The one sticking point that Alex doesn’t mention is software patents. If browsers go out and patent every innovative feature they develop, these features will not be freely available for the W3C to standardize for adoption by the other browsers. But perhaps that’s a smaller problem than the ones we’re faced with currently.
In any case, the W3C needs to stop looking towards the future; until they do, the rest of us will be stuck in the past. The W3C is eminently capable of writing solid specs that describe what browsers do today. They should stick to that (it’s a big job!), and let the world know that adding nonstandard features to web browsers is not a crime.
The future is not built by consensus in a working group; it’s built by visionaries trying stuff out and making mistakes.
This article provided by sitepoint.com.
Matt Webb on the Web 2007 Wrapup on the Web
Ah the end of the year, the time to write top ten lists and predictions. I am not going to go this here. We do that enough in our State of Ajax talks. What I will do though, is the digital version of something I dislike. As an experiment, I used a “highlighter” on Matt Webb’s […]
Ah the end of the year, the time to write top ten lists and predictions. I am not going to go this here. We do that enough in our State of Ajax talks.
What I will do though, is the digital version of something I dislike. As an experiment, I used a “highlighter” on Matt Webb’s piece on wrapping up 2007, which is a fantastic (and long) flow of consciousness that manages to say everything and nothing.
Here are the yellow bits as I saw them:
So what does phenotropics mean for the Web? Firstly it means that our browsers should become pattern recognition machines. They should look at the structure of every page they render, and develop artificial proteins to bind to common features.
While browsers look for patterns inside pages, search engines would look for inter-page, structural features
…
I have a feeling that refactoring code is not a good thing. I am not in favour of deleting code. If there are problems with code the way it is written, there should be mechanisms to code over it gradually, and leave the old code there.
A codebase should be its own source repository: seeing what the code was like a year ago shouldn’t be a check-out from source control, but archeology.
…
What the Magna Carta did - or rather, what the process that the Magna Carta was part of did - was turn the king into a thing. The thing-king is the king revealed. The important feature of the document isn’t the constraints put on the king, but rather the fact that it is possible to bind to the king at all.
This means we’ll have metamarkets, in the end. Mini free markets captured and tuned to perform particular tasks, inside a society we can’t currently grasp, just as China held Hong Kong in a bubble to propel it into orbit, and the Large Hadron Collider intends to create new zones of particular kinds of physics in order to perform scientific experiments.
…
I want to think about social software in reverse. Can we take activities that are already group-based and irreducibly social in the real world, and make software that is good for them?
Perhaps the login system could be based around questions: ‘what is a name of a blonde person in your group?’
…
To generalise Flickr’s attributes, successful interactive systems will bend users back towards them, whether by play or not.
…
The cleverness of Getting Things Done is to wrap this finite-state machine in another finite-state machine which instead of running on the tasks, runs on the human operator itself,
…
Websites can also be seen as finite-state machines that run on people.
Instead of a finite-state machine, think of a website as a flowchart of motivations.…
Imagine popularising a method like Getting Things Done crossed with the creation and value of the diamond industry
I am looking forward to see what you come up with in oh-eight.
Although Smashing Magazine is quite young, a number of things happened in 2007. Aside from dozens of articles, we’ve organized few contests, re-designed our weblog and we also have released two WordPress-themes and a Smashing free font.
In this post we revise what happened on Smashing Magazine over the last year. Smashing highlights, setbacks and small sensations of 2007 — in a brief overview, month by month.
Although Smashing Magazine is quite young, a number of things happened in 2007. Aside from dozens of articles, we’ve organized few contests, re-designed our weblog and we also have released two WordPress-themes and a Smashing free font.
In this post we revise what happened on Smashing Magazine over the last year. Smashing highlights, setbacks and small sensations of 2007 — in a brief overview, month by month.
January
For us, the year began with a small traffic earthquake. The article 53 CSS-Techniques You Couldn’t Live Without has managed to reach front pages of almost every social network; it was recommended by hundreds of bloggers and drawn a huge attention to the Smashing Magazine.
It’s not a secret that this post has become one of the typical posts to follow in 2007. Extremely long and with dozens and dozens of large images. In January we were quite generous about the size of our images. Now, 12 months later, we know better. Currently the post reached 759 comments and trackbacks.
February
With the growing popularity of WordPress also the interest for decent WordPress-themes grows. This not quite new idea brought us in February to 83 Beautiful Wordpress Themes You (Probably) Haven’t Seen.
We’ve spent weeks selecting decent, professional and high-quality WordPress themes. It was worth it. Even although some readers complained that they actually seen these themes, at the moment the article has 849 comments and trackbacks.
March
A scandal in March — nobody wanted to read Google Gadgets, Widgets and Moduls, a well-researched article with many useful references. Apparently, we’ve got to have more images, as we did in the showcase Keep It Simple, Stupid!.
April
We’ve announced the winner of our logo contest. Ruan Deyzel from South Africa designed a Smashing logo we currently use — you can see it on the left at the top.
In April we’ve experimented with new concepts; in the article 35 Designers x 5 Questions we’ve gathered the opinions of 35 renowned experts across the globe. It wasn’t easy and took us much more time than we expected.
The result was an extremely long article with suggestions, ideas and tips from professional designers and developers. Questions: 1 aspect of design you give the highest priority to, 1 most useful CSS-technique you use very often, 1 font you very often use in your projects, 1 design-related book you highly recommend to read.
May
Since May we regularly present colorful collections with high-quality icons, graphics and templates. The first article of its kind, Freebies Round-Up: Icons, Buttons and Templates, has brought us 235 comments and trackbacks.
June
A quite unspectacular month. The most exciting article was probably (guess what!) a list of 80+ AJAX-Solutions For Professional Coding.
July
In July, in the article Wanted: Your 404 Error Pages, we’ve prompted our readers to design 404-error-pages and let us know about them. Few weeks later we’ve published the results in the article 404 Error Pages: Reloaded. We’ve received a friendly applause from our readers and the article was quickly forgotten. Weeks later thousands of Digg comrades passed by generating a huge traffic spike. After Digg’s front page the article found its path to other social networks. In the end, it was much more successful than we expected.
In comments Digg users complained about a “not-that-accurate” selection of the best 404-pages. The truth is, it wasn’t supposed to be the ultimate Best-Of collection; it was just a collection of creative ideas provided by excellent readers of a small weblog.
The most colorful, but not quite popular article of the month was Exploring Design: Outstanding Start Pages. We love large images, you know.
August
In August we’ve published one of the most beautiful articles we’ve ever written — Data Visualization: Modern Approaches was very well linked, cited and praised.
The typography-lovers could celebrate their passion in the article 80 Beautiful Typefaces For Professional Design.
September
In September we’ve celebrated our One-Year-Anniversary and therefore smashed our readers big time, one week long. We’ve organized two give-aways and offered our readers over hundred presents — books, accounts, tools and services. These posts had 2101 and 1855 comments and trackbacks, accordingly.
October
Screensavers - Best Of was the most colorful and popular article of the month, for the whole family, not only for designers and developers.
November
The November had a little surprise for us. The post User Experience Of The Future, actually a tiny creativity portion for monday inspiration, with only 12 images (nothing compared to our previous posts), was linked so often and so quickly that our web-hoster was fed up with the amount of traffic the article generated. Consequently the december has brought us a lot of problems.
December
The worst month of the year. Our lovely hoster (manitu.de) throttled down our server, wasn’t cooperative, lied to us and finally thrown us away. The result was We Experience Serious Server Problems. We’ve received many suggestions and offers. Not everyone knows that a project like Smashing Magazine can’t be hosted on “usual” Webspace or on a Managed Server. We need more. And terabytes of traffic are also quite costly. However, now we are finally back on track and run on a new server (more information in January).
Why Smashing Highlights?
Why would someone write an article like this? What are the benefits and why are such revisions useful? Yaro Starak knows why and provides answers in his article What Did Blogging Teach You In 2007?










Allison Hannigan…
The pen is really mightier than the sword, as you have proven here….