Internet Explorer Javascript Errors

Evolution and Geneone have been plagued by some Javascript errors in Internet Explorer over the last few weeks. To be honest, the number of people who play Evolution or visit my blog using IE are so low that no one has actually bothered complaining.

These errors included Object expected and "Expected identifier, string or number". I’ve never tried to actually fix these errors before because IE’s script debugging really really sucks. 

Windows Scripting Debugger can be a useful tool for debugging Javascript but be warned that it is very very unstable and severely affects the stability of your computer.

Expected identifier, string or number

This was an annoying little bug caused in a class because of a comma at the end. In Javascript you have lists like:

var list = { opacity: 0.5, height: 0.5} 

Similar syntax is used to group functions:

var MyFuncs = {
bleh : function() {},
bleh2 : function() {},
}

The above code should work fine in real web browsers such as Firefox. IE will give a screwed up error such as "Expected identifier, string or number". Just remove the comma after the last function and the error be gone.

Object Expected

If you document.getElementsById(‘nonexistantitem’) in Firefox and try to retrieve an attribute such as previousSibling, Firefox won’t complain. IE will. This was causing issues as I had a little bit of Javascript which searched for the "Entry Title" box above the "Message" box in the Object Creation forms. On pages where the Entry Title field weren’t shown, IE would freak out as the previousSibling would return False.

I should thank neonDragon for his assistance in resolving these issues

Standard User Interfaces

Why does it seem as if every single application these days decides it has to ignore the native look of Windows and come up with it’s own?

Instant Messaging Apps

Media Players

Media Players

iTunes, Songbird, Winamp also have non standard interfaces. I don’t have them installed so didn’t include them.

Gaming

 

Microsoft Office is another notable application which fails to implement a native look – 2003 is a strange colour and 2007 does away with menus.

Now I’m all for programs taking liberties and theming them to look better and I don’t believe the native look of the OS should stop this. But in almost all of these cases, the custom looks look worse than the my default Windows theme (Luna Element) and many of the custom UIs make the programs harder to use. 

Launchy

Launchy is an interesting Windows application which provides you with an alternative and quicker way of accessing your programs. It’s a small program which loads with Windows but it stays out of the way until you press Alt+Space.

Launchy

When you do this, it’ll ask you to start typing the name of the program you want to launch. The first time I used it and typed ‘f’ it thought I wanted Fox. When I typed up to ‘fire’ it thought I wanted Xfire. Only when I typed ‘firef’ did it know I wanted to launch Firefox.

The second time, it had learnt that I probably wanted Firefox and just typing in ‘f’ will give me Firefox.

It can also be configured to load music, documents and favourites entries. It’s a nice way of launching an application quickly without faffing about with the Start Menu and the endless submenus you may have. You don’t have to think about who manufactured or authored the game; you just type it’s name.

My Start Menu "programs" list currently fills 3 columns even though I’ve been making an effort to keep to 2 columns. I haven’t tried Vista so I’m not sure whether this works on a similar system to Vista’s start menu which allows you to enter a program name.

CSS Browser Selectors

Signal vs. Noise pointed to a really nice and elegant way of deliverying CSS styles to specific browsers. At the moment, you will probably be delivering styles to Internet Explorer using the * html hack:

* html .box { padding: 5px; }

The * html CSS hack is actually fixed in Internet Explorer 7 so doesn’t work anymore. Besides, CSS hacks and using bugs in the CSS parser in such a way, is considered harmful. The recommended way of sending a CSS style to Internet Explorer is to use conditional comments but these can get real ugly. It breaks the syntax highlighting in most HTML editors and if you’ve got tons of IE-only styles interspersed throughout a document it can get ugly.

You could collect all your IE-only styles into one section so you only have to use one comment, but this can make it harder to find the relevant styles.

Browser Selectors

Browser selectors involve using a small piece of server side or client side scripting to detect the browser and to assign a class to the <html> element indicating the browser.

You could do it with a little PHP:

<?php
if(strstr($_SERVER['HTTP_USER_AGENT'],"MSIE")) {
echo '<html class="ie">';
} else { // You'd need to do some more detecting, for simplicity sake I'll leave it out. You may also want to include versions.
echo '<html class="firefox">';
}
?>

(You could also use a little Javascript to check for IE (window.all && !window.opera) and set the class name of the html element through the DOM) 

You can use CSS which looks something like:

.ie .box { padding: 5px; }
.firefox .box { padding: 10px; }

A very nice and very elegant way of doing browser specific styles without hacks. I’m surprised nobody has thought of this before.

Heatwave

The heatwave has been driving me insane. I don’t know whether it’s the deafening whirr of the computer or perhaps it’s the fact that when I put ice cubes in my drink it melted within 4 minutes. Opening the doors and the windows, turning on the fans, they don’t seem to help. The flies come indoors and circulate under the lights. They stand on the keyboard and the screen. Or they circulate above your food.

I’ve measured 35 degrees (308K, 95F) in my house but some friends have measured 38 in their gardens (311K, 100F). That’s some 25 degrees warmer than we’re used to in the UK. It has been said that the temperature on the London Underground has reached 48C (321K, 118F). It’s even worse with the amount of people on the underground.

Right now, it’s warmer than Madrid (32C), Hong Kong (30C) and Miama (31C) and almost as warm as Cairo (37C). There have been reports from across the UK of roads melting and people losing their shoes. Right now in the area around me, there are 7 gritters out trying to stop the roads from melting. At Gatwick, 36.3C was measured (in the shade) which makes today the hottest ever July day measured.

Many schools in the area have been closed. Some schools have been closing at 1:30 today whilst others haven’t bothered to open at all (it’s the last week of term anyway). Over the last few days, I’ve failed to do anything particularly useful – it’s too hot to code or even to write a proper blog post.  

It’s forecast to rain tonight and the temperature should go down a good 10 degrees. However, a very warm August is already forecast.

Hotness Prevails

Microsoft's Live.com the worst search engine ever?

I was trying out some alternative search engines earlier as I wanted to become less reliant on Google. Live.com Search is supposed to by Microsoft’s Google killer. I think it’s absolutely terrible.

Take a look at the top results for Firefox on Live.com:

Live.com Firefox

The official Firefox download page isn’t even even in the top 20 results. The top result is a UK company called Firefox which is an acceptable result but most people won’t be looking for it.

The second result is a spammy page which makes money by providing a Firefox with Google Toolbar download. Compare the results to those given by Google which include official download pages, Firefox advocacy site "Spread Firefox" and a link to the Firefox Wikipedia page. Live, in contrast, has an Uncyclopedia result in the top 10.

It doesn’t seem to be limited to just Firefox, Linux comes up with pretty poor results. Even a search for Windows doesn’t even bring up the official Windows XP page. 

Worst search engine ever? 

Web Standards

Jeffrey Zeldman‘s latest post on the W3C had me thinking a bit about standards.

Zeldman writes:

Some of the best minds working in web standards have been quietly or loudly abandoning the W3C. Bjoern Hoehrmann is the latest. His reasons for leaving make compelling reading (hat tip: Terje Bless). I believe in W3C standards, particularly the ones you and I use every day, but I worry about the direction in which the W3C is headed.

This reminded me of a recent discussion in the comments for Reflection.js v1.5. I argued that even though HTML 5 and Web Forms 2 weren’t developed by the W3C but the WHATWG, they were still standards. Determining whether something is a standard isn’t black and white – there are standards created because everyone using them (e.g. MS Office and Flash) even though they are proprietary and other people can’t implement them.

There are standards such as OpenID and RSS 3.0 which seem to have been developed by a community or an individual but which have never taken off. And then there are the standards ratified by the W3C or IETF which no one cares about. If a specification says one thing but everybody implements it differently, are the people using it being non-standard or is the specification a non-standard?

For me, a standard is simply a convention where people agree to use a piece of technology in the same way. It doesn’t matter who developed it or whether it is recognised by some self-decreed standards organization.

On the subject of HTML 5, I’m a big fan. It’s an opportunity for progressive enhancement and solutions which really solve real-world problems rather than the W3C’s XHTML 2.0 which reinvents the wheel for no good reason and doesn’t actually solve any of the problems anybody has.

Fun with MSN Messenger: Handwriting

One little known feature of MSN Messenger (or Windows Live Messenger) is the handwriting features. I believe this feature was first introduced to Tablet PC users with MSN Messenger 6 requiring a patch to enable it for normal desktop PC users. In MSN Messenger 7, all users with Windows XP and the required libraries for Ink should be able to use it.

Below the message box in MSN Messenger, you’ll probably have two tabs – the first one allows you to create handwritten messages.

WLM Handwrite

You may find it actually quite hard (and slow) to write legibly using your mouse. Consider getting an optical mouse or if you’ve got tons of cash, using a tablet can really make it a lot easier. However, you should be able to get a pretty decent drawing using a normal optical mouse.

You’ll probably want to drag the drawing area so it’s a little bigger – use the grippy above the drawing box.

Editing and Adding to Drawings 

Another great thing about handwriting is that it is sent as a vector of strokes. This is dead cool as you could drag someone’s drawing from the conversation into your drawing box and then remove certain parts of it. You could deface other people’s drawings and messages by drawing crosses and sqibbles all over it which is good fun.

Defacement 

Another nice thing you could do with this is to draw together. If you want a quick and simple game of Tic-Tac-Toe, the first person draws a 3×3 grid and makes their first turn. The other person then drags that drawing and drops it onto their handwriting box, adding their own move and so on.

You could also collaborate with someone to draw a piece of art over MSN Messenger, each taking it in turns to add something to the drawing. This can create some really interesting pieces of art especially as you don’t know what the other person will draw.

As an added bonus, you can scroll up the window and see how the piece of art progressed from the start to the finish. And if someone defaces the drawing, you can always return to an older version.

When your drawing is finished, copy it and paste it into an image editor and save it as a GIF/JPEG image for publication. 

If you use Messenger Plus! Live and chat logging, it’ll automatically save a JPEG of every single ink message you send or recieve. You could load this into a GIF animator and create a nice slideshow showing the progression of your art piece.

Geneone 0.6.7 Technology Preview

I’ve just released an updated build of Geneone which features all of the modifications and improvements made over the last month.

What’s changed? 

Key changes include:

  • Replacement of Smarty templating engine with Gene_Template
    This means you can now use the more powerful and easier PHP in your templates. Templates should also be simpler to understand.
  • Drafts
    You can now save half-finished blog entries or forum posts to the server and return to them later. More information in the post about drafts.
  • User Interface Update
    In the continuing effort to try to remove all GPL-licensed code from Geneone, I’ve replaced the Crystal SVG icons with icons from the Tango Project. There are also some error message and moderation UI changes.
  • Syndication
    Feeds now use the Atom 1.0 syndication format and blog entries reference the feed URL of the main blog as well as the comment feed.
  • Revisions
    You can now revert to older revisions of a document.

See full changelog.

Download

Geneone is still in a technology preview state. It isn’t even alpha yet, so you should not run it on a production website. This release is unfinished and will contain bugs. There will be no way to upgrade from this version to a later one and pretty much every version has broken backwards compatibility with the previous one.

If your still interested, download it (810 KB).

Download Squad – Blog of the Week

Download Squad is a fabulous blog about technology. Despite it’s name, it’s not about downloading and it’s not a linkdump of downloadable utilities. It links to some articles of interest, cool programs which you can download to do cool stuff and also cool webapps. The blog is updated really frequently with a dozen or so entries a day but all the entries seem to be well written, pretty concise and interesting.  

It’s a great way to keep up with technology happenings but also to find out about innovative programs and web applications without all the babble and boring venture funding talk you get on sites such as TechCrunch.