Web development
I downloaded Google Chrome tonight. It’s the pretty! Only scary thing is something Joe noticed… how much the logo looks like GlaDOS from Portal. Remember that time I pretended to murder you?
In 2008 I did a talk at a .NET user group in Oxford about the nuts and bolts of how objects actually work in javascript. Here are the presentation slides and code samples.
Javascript anonymous functions
on 23 Aug 08
(46 comments)
Anonymous functions are functions that are dynamically declared at runtime. They’re called anonymous functions because they aren’t given a name in the same way as normal functions.
Functions in javascript are first class objects. This means that javascript functions are just a special type of object that can do all the things that regular objects can do. Really, just like any other variable Here are a few of the important objects things that you can do with a function in javascript. A [...]
Javascript objects are basically just hash tables, a group of related properties and functions that can be accessed by a key. Properties are dynamically added at runtime. Methods are just properties that happen to be functions. Building a simple object The simplest way to build objects in Javascript is by declaring a new variable of [...]
How javascript objects work
on
(9 comments)
A look at the features of the javascript that can be used to write object oriented code and how javascript objects really work at the language level. Useful for people writing bare metal javascript or to understand how you framework really works.
My favourite new webdev tool of the moment is IETester. You can use it to test pages in IE5.5, IE6, IE7 and IE8 all on the same machine without messing around with your main installed version of IE. I was pretty amazed when I saw it because I’d always believed that it was a bit [...]
Use negative margins and light weight semantic markup to display a form with the labels on one side and form elements on the other. No tables or divs needed at all. Works in all browsers. Noone who wasn’t a web developer would believe what a pain it is finding a good solution to this little problem.
Media queries are extra params for the CSS @media types that you can use to target styles for different devices based the device’s capabilities like dimensions and colour depth. They are part of the W3C CSS3 standard and are supported in the latest vesion of Opera (desktop and mini versions), Firefox and Safari. Media queries [...]
The document.querySelector javascript method queries a HTML document for DOM elements that match a CSS selector. It is built-in browser support for the selector query features that made javascript libraries like JQuery so popular. It is part of the W3C selectors api spec. This feature has excellent support in recent versions of all desktop browsers, [...]
The FAQ on del.icio.us made me laugh: (I wonder if they could do something about the new X-Files movie next…?)
I’m getting quite interested in Safari because it seems to be where a lot of the early implementations of interesting new standards is happening. It makes me happy to get a little glimpse at what the future of web development might look like. :) The problem is Firefox has really spoilt me with all it’s [...]
Neat little tip I found (in my old, old blog archives) is that you can switch Opera into hand held emulation mode by hitting Shift+F11. It’ll take your site and serialize the design to fit on a small screen like on your phone: It also will honour the @media handheld stylesheet so it’s a convenient [...]
One of the guys at work inspired me to try a mouse gestures plugins for Firefox today. For the uninitiated, mouse gestures are like keyboard shortcuts for the mouse. Instead of holding ctrl+c, you do a little drawing on the screen while holding down the right mouse button to make something happen. For example when [...]
Learnt something new today! There’s a repository of open source javascript code called JSAN modelled on the perl version. There’s a whole lot of interesting stuff on there like UI widgets, animations and AJAX. I haven’t tried any but it’s nice to know there’s somewhere you can see what other people are doing.
One recurring problem I’ve had when using a function from a custom javascript object as an event handler is that when the event handler is called the “this” property of the function no longer references the object it originally belonged to. To show you what I mean, take a look at this simple javascript object. [...]
Today I found out that gmail supports checking and storing POP3 mail and it made me wonder if I even need a desktop email client any more. It has everything I use in Thunderbird (sorting, filtering, searching, address book) with the big advantage of being on the network and therefore accessible from any computer. So [...]
I wanted to document a bit of an edge case browser incompatibility that I found: that event handlers aren’t always run in the same order in IE as they do in other browsers. It’s a bit of a strange case where we were doing something not entirely sensible. :) There was an input box which [...]
Ok, I’m now officially in love with Firefox. My Vista install has mysteriously become flaky recently and is randomly taking down programs. When Firefox crashed, not only did it remember which tabs I had open, it also remembered the contents of what was in the form that I was filling in at the time of [...]
On the ever interesting topic of curiosity over good sense, I had an interesting discussion about how far you can nest HTML tables in different browsers. The person I was talking to had noticed that at a certain point the tables just stopped displaying when they tried to take their web rendering to an extreme [...]
Microsoft is amazing. WPF/E has been around for ages. They give it a fancy name and run a keynote about it at MIX and suddenly it’s the biggest thing to hit (Microsoft) web development since someone came up with a catchy name for ajax. This week it seems like its the only thing that anyone [...]
I was a bit disappointed when I read that public IE bug database isn’t being reopened. The reason given was that the volume of unusable bug reports submitted far outweighed the useful stuff. Apparently some people used it to tell the team how much they hate IE. :) I can understand that being a problem [...]
I came across a weird feature of javascript last week, a way of spanning javascript strings over multiple lines. To do it you put a ‘\’ character just before the line break and javascript knows it should keep going on the next line: var mystring = "hello \ [...]
DIY javascript stack trace
on 12 May 07
(12 comments)
How to use arguments.callee to walk up the javascript call stack when you’re doing something that a debugger can’t help you with.
It’s ER night again tonight so I’m going to update with a totally dorky technical web thing I did today that I thought was interesting. :) I found a strange IE behaviour today in a sample I was looking at. The problem was with a javascript object that had a reference to a DOM object. [...]