Archive for February, 2008

Useful Keypresses in browsers

Thursday, February 21st, 2008

What’s the best keypresses for browsers?

I’m keen on the following:

  • Alt-D Go to Address Bar
  • Ctrl-Enter Add the www. and .com to your word in the address bar
  • F11 – Ok, it takes you to full-screen.  Not very handy.  But!  Tapping F11 twice makes a non-resizable popup window resizable (IE only).

Any other good ones?  I’d be keen to know the keypress to bring up the IE Dev Toolbar.

Stars on the blog

Sunday, February 17th, 2008

I’ve added planets and stars to my sky when the sun sets. Best thing is, these are technically accurate. The sun follows the correct path across the sky and sets at the right time. The sky shows the view facing South from London.

(more…)

Script speedup: Running functions asynchronously

Wednesday, February 6th, 2008

This is something I’ve seen a long time ago, but never actually had the script for.  If you’ve got a slow process in your loop, for example:

for (var i=0;i<jedarray .length;i++) {
     reallySlowFunction("bob", "ted", fredObj, jedArray[i]);
}

You can just throw the function off to my function be executed in its own little time, and your loop can carry on.

for (var i=0;i<jedArray.length;i++) {
     setAsync(reallySlowFunction, ["bob", "ted", fredObj, jedArray[i]] );
}

Much faster! (more…)

Creating new HTML elements

Friday, February 1st, 2008

It’s possible to create new HTML elements, and apply presentation and action to it.

Jon Resig mentions it here, suggesting it would be a good way to implement HTML5 in an earlier browser.
http://ejohn.org/blog/html5-shiv/

He’s right.  It would be good.  But I can see applications of it for microformats and semantic markup too.
If you attach behaviors (using Dean Edwards’ Mozilla extension) to the element, you can add script actions as well as style.

So you can essentially rewrite the browser using JS. (more…)