Archive for the 'JavaScript' Category

Lazy HTML evaluation

Jun 8th, 2011

#7 This post is part of the Velocity countdown series. Stay tuned for the articles to come. Some time ago Google talked about using a sort of lazy JavaScript evaluation which especially helps mobile devices. The idea was to comment out a chunk of JavaScript you don’t need right away and serve it this way. […]

 

HTTPWatch automation with JavaScript

Apr 10th, 2011

Background HTTPWatch (automation) …with PHP (and again and again, and response) JavaScript shell scripting I gave this short presentation at the recent Yahoo FE summit’s open mic, here are the slides and some notes. Slides and screencast vid JavaScript shell scripting View more presentations from Stoyan Stefanov Screencast to see the thing in motion: Notes […]

 

JavaScript-style object literals in PHP

Mar 20th, 2011

The object literal notation in JavaScript looks like: var fido = {name: "Fido", barks: true}; or var fido = {}; fido.name = "Fido"; fido.barks = true; From assoc arrays to objects In PHP you would call that an associative array. $fido = array( ‘name’ => "Fido", ‘barks’ => true ); And you can easily make […]

 

cssmin.js in windows shell

Oct 29th, 2010

JavaScript can run virtually anywhere, including as a windows exe and the windows command line. Say you have a JavaScript function foo() function foo(input) { var output = input; // .. unicorns return output; } In order to make this a windows shell script you add at the and a way to read standard input […]

 

Preload, then execute

Oct 23rd, 2010

I talked before about using an object element to load scripts and styles without executing/applying them to the current document. And this is nice for preloading assets – faster and less error-prone than simple inclusion if the document or iframe. But what about preloading assets (scripts) and then executing them on the current page? Turns […]

 

The European Tour 2010

Oct 2nd, 2010

So it’s been pretty quiet around here. I’m still alive and very much so. Just awfully busy. Bulgaria I took a long trip in Bulgaria. About 1 month and 20 days. Including the traditional around-Bulgaria let’s-get-drunk-in-different-cities-every-day tour de force with the gang. With unusual amount of guitar playing this time. Not all fun and roses, […]

 

JavaScript JS Array Documentation (#jsonf, #promotejs)

Sep 26th, 2010

Join me in the initiative to promote proper JavaScript documentation from MDC. It’s embarrassing the quality of links that pop up in search engines when searching JavaScript general questions. Let’s help connect newcomers to JavaScript with better reading. PromoteJS.com will give you a unique code.

 

Preload CSS/JavaScript without execution

Apr 21st, 2010

Preloading components in advance is good for performance. There are several ways to do it. But even the cleanest solution (open up an iframe and go crazy there) comes at a price – the price of the iframe and the price of parsing and executing the preloaded CSS and JavaScript. There’s also a relatively high […]

 

Publishing 5 books this year

Apr 1st, 2010

So I’ll be publishing 5 books this year. Isn’t that incredible? Is it even possible? And good quality books at that? It’s a nice challenge (my last year’s challenge failed, I didn’t even bother to count how bad it failed). I think it’s possible, especially if you bend a little bit the meaning of “5”, […]

 

YUICompressor’s CSSMin

Mar 10th, 2010

Honored to be a part of the YUI project, I am now helping with the maintenance of the CSSMin part of the YUICompressor. My changes are now part of the trunk on github, so I’m official. Next on the agenda is documenting the thing, so that’s what I’ll try to do here, maybe in a […]

 

One-click Minifier Gadget (OMG) – initial checkin

Jan 31st, 2010

So I’ve been thinking and talking to folks about this idea of having one-stop shop for all your minification needs. Minification of JS and CSS as well as image optimization helps site performance by reducing download sizes. This is good. But not a lot of people do it. People don’t do it, because it’s a […]

 

Extreme JavaScript optimization

Dec 20th, 2009

2010 update: Lo, the Web Performance Advent Calendar hath moved Dec 20 This article is part of the 2009 performance advent calendar experiment. Today’s article is a second contribution from Ara Pehlivanian (here’s the first). There’s a Belorussian translation provided by Patricia. Thanks! Ara Pehlivanian has been working on the Web since 1997. He’s been […]

 

The new game show: “Will it reflow?”

Dec 19th, 2009

2010 update: Lo, the Web Performance Advent Calendar hath moved Dec 19 This post is part of the 2009 performance advent calendar experiment. Stay tuned for the articles to come. Intrigued by Luke Smith’s comment and also Alois Reitbauer’s comment on the previous post about rendering I did some more testing with dynaTrace and SpeedTracer. […]

 

DOM access optimization

Dec 18th, 2009

2010 update: Lo, the Web Performance Advent Calendar hath moved Dec 18 This post is part of the 2009 performance advent calendar experiment. Stay tuned for the articles to come. This blog series has sailed from the shores of networking, passed down waterfalls and reflows, and arrived in ECMAScriptland. Now, turns out there’s one bridge […]

 

Rendering: repaint, reflow/relayout, restyle

Dec 17th, 2009

2010 update: Lo, the Web Performance Advent Calendar hath moved Dec 17 This post is part of the 2009 performance advent calendar experiment. Stay tuned for the articles to come. UPDATE: Ukraine translation here. Nice 5 “R” words in the title, eh? Let’s talk about rendering – a phase that comes in the Life of […]

 

JavaScript loading strategies

Dec 15th, 2009

2010 update: Lo, the Web Performance Advent Calendar hath moved Dec 15 This article is part of the 2009 performance advent calendar experiment. Today’s article is a contribution from Ara Pehlivanian, author of two JavaScript books. Please welcome Ara and stay tuned for the articles to come. Ara Pehlivanian has been working on the Web […]

 

Reducing the payload: compression, minification, 204s

Dec 11th, 2009

2010 update: Lo, the Web Performance Advent Calendar hath moved Dec 11 This post is part of the 2009 performance advent calendar experiment. Stay tuned for the next articles. After removing all the extra HTTP requests you possibly can from your waterfall, it’s time to make sure that those that are left are as small […]

 

Duplicates and near-duplicates

Dec 9th, 2009

2010 update: Lo, the Web Performance Advent Calendar hath moved Dec 9 This post is part of the 2009 performance advent calendar experiment. Stay tuned for the next articles. One of Yahoo!’s first batch of performance best practices has always been “Avoid duplicate scripts” (check Steve Souders’ post). Later we added “… and styles”. This […]

 

Reducing the number of page components

Dec 5th, 2009

2010 update: Lo, the Web Performance Advent Calendar hath moved Dec 5 This is the fifth in the series of performance articles as part of my 2009 performance advent calendar experiment. Stay tuned for the next articles. Let’s talk a but about waterfall optimization – the first thing that happens in Mr.Page’s life. The best […]

 

Statsy – more data points for markup quality

Nov 30th, 2009

In the spirit of the content-to-markup ratio bookmarklet, here’s another one that gives you some more data points to help you judge the quality of a page’s markup and help answer the old question – where does all this page weight go. Install the statsy bookmarklet Drag this link to your bookmarks: statsy the results […]

 

Browser’s implied globals

Oct 20th, 2009

Like it’s not bad enough that JavaScript has implied globals (forget var and you create a global), but the browsers have decided it’s a good idea to add more pollution to the global namespace. This has been a source of frustration before with IE, it’s really hard to understand the logic behind it, but it’s […]

 

cssmin.js

Sep 23rd, 2009

cssmin.js is a JavaScript port of YUICompressor’s CSS minifier. The motivation Minifying CSS helps reduce file sizes and makes your pages faster and your users happier. YUICompressor is cool but is written in Java, which can be a blocker for some folks – you know JVM, command line, classpaths… No more excuses, now you have […]

 

JavaScript shell scripting

Sep 3rd, 2009

As you probably know, JavaScript is not limited to the browser. There’s server-side JavaScript, JS for various extensions, you can script Photoshop operations with JavaScript if you feel like it. Or compile Windows executables. You see where I’m going with this. JavaScript is everywhere 🙂 And yes, you can do shell scripting in JavaScript. On […]

 

The art and craft of postload preloads

Aug 27th, 2009

What can your tired old page, once loaded and used and read, can do for your user? It can preload components needed by the next page, so when the users visit the next page, they have the new scripts, styles and images already in the cache. Next page loads faster and the user’s happy. On […]

 

Slides from JSConf

Apr 28th, 2009

I’m back from the most excellent JSConf (JavaScript Conference) in Washington D.C. I’m tired and need sleep but the conference was, hands down, the best conference I’ve ever attended. It was all about the community, it was inexpensive, with parties all around, both speakers and attendees were treated exceptionally well, in fact there wasn’t a […]