Web Programming

Internet Explorer 7 Beta 2 review

Oliver Brown
— This upcoming video may not be available to view yet.

Well since I tend to use Firefox here at work I figured I could install IE7 without too much risk. And I must say it’s actually quite good.

Initial impressions

The most obvious feature is thye really minimalist chrome. The back and forward buttons are a little smaller and now to the left of the address bar; refresh and stop are to the right and then underneath that are tabs. By default there is no application menu (File, Edit, View etc). which strikes me as odd. But to the right of the tabs are other buttons to do common things that you’d normally use the menu for. Speaking of opening new tabs, there is a special thin blank tab to the right of the others that you click to open a new one.

Conditional tags

IE has a special feature called conditional tags that let you specif markup just for IE that other browsers ignore. This doesn’t seem to work in IE7. Unfortuantely this means a 1px rendering error is present on my blog. The irony being I’m assuming it’s been taken out because they think they don’t need it anymore…

Zooming

The zoom feature is snazzy and most of all, actually works. It scales everything properly and still renders text as vectors. Even better is that the tab preview (thumbnails of all the tabs) just use zoomed out versions of the page. This means the thumbnails are completely live. Well almost. It seems you get snapshots of plugins (although they work fine when viewing a normal zoomed page, not the overview thingy).

It also works with the dev bar add on I installed.

Tabbed browsing

New to IE and probably the most requested feature (beyond standards compliance :P). And it works. There are some subtle differences between it and Firefox which will take a little geting used to. For example IE puts the cross to close a tab on the tab itself instead of on the right. And newly opened tab appears immediately to the right of the currently opened one instead of at the end of the list.

Acid2

The acid test was invented to test a web browsers CSS standards compliance. Acid2 is it’s sequel. Well IE7 fails the Acid2 test miserably. I mean it’s truly awful. In Firefox and Opera you can at lest tell what you’re supposed to be looking at.

Multiple themes, sort of

Oliver Brown
— This upcoming video may not be available to view yet.

To counteract the fact that I’m using Kubrick, the single most common Wordpress theme (by virtue of being the default) I’ve started to develop different themes for different categories. The first I’ve implemented is PHP which now has a different colour scheme and a different header image.

Windows Live Mail dies a little

Oliver Brown
— This upcoming video may not be available to view yet.

Windows Live is the name for the new set of technologies software and computery goodness Microsoft is developing.

A lot of the components aren’t especially related, it’s just a brand name of sorts. Part of it is Windows Live Mail, designed to ultimately replace Hotmail. As of this morning, it doesn’t work on Firefox. You are greeted with the normal Hotmail interface and a message saying due to various problems they’ve rolled back to a previous version meaning Firefox users have to use Hotmail Classic. Well it is beta (and they’ve said it’s beta instead of releasing it and then finding these problems) so I’ll let them off.

PSP browser support

Oliver Brown
— This upcoming video may not be available to view yet.

With my broadband connection came a wireless network. So I tried browsing with my PSP. And it is a lot better than I expected. Except when browsing my own blog :(

I figured the easiest way to make it work was to send it the XHTML Basic version. So you should now be able to browse my site with a PSP without any hassle :D

Detecting the PSP browser**

Detecting a PSP is really easy. It sends a custom HTTP header: HTTP_X_PSP_BROWSER which contains the firmware version. Just check if that header is set. In PHP you just need to do:

if (isset($_SERVER['HTTP_X_PSP_BROWSER'])) $psp = true;

Now Google push AJAX development

Oliver Brown
— This upcoming video may not be available to view yet.

I recently posted about BackBase, an expensive (for commercial use) AJAX development thingy*. Well Google have produced something similar for free Google Web Toolkit.

Although the end results are the same (as far as the user is concerned) there are important differences. The BackBase software is entirely client side. You write server stuff as normal, output BackBase code and the browser with JavaScript handles everything. The Google system is client and server orientated and odes more work on the server. The server also has to be running Java. It also has better browser support.

This could be a reason for me to learn Java, something I’ve managed to avoid for quite a while now…

* It’s actually an XML based markup language combined with a real time JavaScript processing engine.

German flip cards Google gadget

Oliver Brown
— This upcoming video may not be available to view yet.

I’ve created a clever German flip card gadget for Google homepage. It displays a German word for a few seconds and then shows it’s translation. And then repeats with a new word. The vocabulary is very small at the moment but it will increase by at least one per day.

At the moment it also limits itself to 5 words per viewing. That is after showing five cards it loops (if it didn’t you’d never actually begin to memorise them).

Google Homepage

To use Google personalised homepage, you must have a Google account. When you have one, go to “Personalised Home” (links for that and to create an account are in the top right corner of Google’s homepage).

Adding the Gadget

From your personalised homepage, click “Add Content”, then “Create a Section” and then put the following URL in the box: http://www.oliverbrown.me.uk/gadgets/flip.xml . Then just click “Go” and you’re done :)

If anyone is interested I might extend the idea to be more flexible.

So where are the Google gadgets

Oliver Brown
— This upcoming video may not be available to view yet.

If you use Google personalised homepage, you can add Google gadgets to them. A Google gadget is just an XML file (or more usually the XML output of some dynamic page) that is displayed. There is a well developed API and you can do quite a lot of nifty stuff with them. But they don’t seem to be that popular (searching for Google gadgets, with Google gets very few relevant results).

There are quite a few in their gadget directory but very little mention of them outside Google…

Multiple forms in ASP.NET

Oliver Brown
— This upcoming video may not be available to view yet.

I previously ranted that being unable to have two ASP controlled forms in a single ASP.NET page is a serious flaw. They may be a way round it though. I would assume that ASP.NET can’t output two “smart” forms (the ones with runat="server") on the same page but I’m pretty sure that there is nothing stopping a HTML page itself actually holding two of them. Of course that could be wrong.

Essentially all you have to do is load the extra forms using AJAX and I think everything will work.

(I’m working a on a page (not in ASP.NET) that has a table of data with a status column. Each column needed to have a drop down box letting you change the status. Since the number of statuses is large I decided to have a link that AJAXly changed into the dropdown box and a button when you clicked it. Of course you could click all the links and not submit any of the forms leaving you with a page that actually has a bout 30 forms on it.)

BackBase really pushing AJAX

Oliver Brown
— This upcoming video may not be available to view yet.

BackBase is another AJAX toolkit. This one is different though. It’s not really an AJAX toolkit, more a toolkit powered by JavaScript taking advantage of AJAX.

The clue is the price. Yes it has a price - $2000 to be exact. There is a “community edition” that is free for personal use though. Anyway, I don’t have time to run down all the features but basically it defines a whole new bunch of tags allowing you to create complicated content in a declarative HTML style way. These tags are then translated into proper XHTML on the fly by the back end JavaScript engine. Since the clever work is actually handled by the browser, you’re free to use whatever you like on the server (PHP, Ruby) including static HTML pages - outputting BXML is no different to outputting HTML. In fact BXML has a very ASP.NET feel to it and embedding BXML into an XHTML page along with ASP content could have the ultimate cleanness about it (syntax isn’t one of my complaints about ASP.NET).

It should be noted that Microsoft are working on Atlas which could be something very similar but I haven’t looked into it… It all seems very clever.

Silly things with JavaScript closures

Oliver Brown
— This upcoming video may not be available to view yet.

From a theoretical programming point of view, JavaScript is immensely cool. You can do some amazing things with it. Although I’m not entirely sure whether you should.

For example I had a bunch of elements on a page I needed to update using AJAX. I needed a function I could pass the URLs and ids of elements to replace with those URLs and then have it perform each replacement in turn (I’ve seen IE have problems with simultaneous AJAX requests).

First I replace a simple replace_id function that accepts three arguments. An element id, a URL to GET to replace its contents with and finally a function to be called when it’s all completed.

And then things got silly.

function chain_replace(urls, ids) {
    id = 0;
    next_id = function() {
        if (id < = ids.length) {
            return function() {
                replace_id(urls[id], ids[id++], next_id());
            }
        }
    };
    next_id()();
}

Now the next_id()(); bit towards the end should be a clue that something a little odd is going on. But I must confirm that this code does actually work. With enough arguments it might make the browser explode with some sort of call stack problem though…