Skip to content

IE Javascript problem?

What would you expect the bit of javascript below to do?

<html>
<body>

    <select id="testing">
    </select>

    <script>
        var testing = document.getElementById('testing');
            
        var georgeOpt = new Option("George", 1);
        testing.options[testing.length]=georgeOpt;        
        
        var paulOpt = new Option("Paul", 2);
        testing.options[testing.length]=paulOpt;    
            
        var johnOpt = new Option("John", 3);
        testing.options[testing.length]=johnOpt;    
            
        var ringoOpt = new Option("Ringo", 4);
        ringoOpt.selected = true;
        testing.options[testing.length]=ringoOpt;        
    </script>

</body>
</html>

In Firefox the SELECT is displayed with Ringo selected, in IE John is selected. If you swap the last two lines of script – Ringo is selected in both browsers. Easily fixed so its no biggie. I guess it doesn’t really make sense to tell an OPTION it is selected before it belongs to a SELECT?

Scott Guthrie’s ASP.NET + Atlas Tutorial

Pretty cool demo of some of the new features of VS.NET 2005 + ASP.NET from Scott Guthrie here. Scott shows off the new features in: DataSets, master pages, and Atlas.

Try count how many times he says ‘go ahead’.

How is he recording that? Maybe it’s that ‘clapper board’ icon in the systray? Looks like an Office icon. Got me interested in recording tutorials via screen cam software. Discovered you can record your own with the Windows Media Encoder. So here’s my first attempt at a screen capture tutorial.

Google Trends

Okay, Google’s latest project Google Trends is pretty entertaining.

Type in a search term like, ‘hurricane katrina‘ and get back a graph of search volume over time, and a table of the cities where the search term was most popular. The results are normalised, i.e. the table is ordered by searches for ‘hurricane katrina’ over the total searches for that city. The labels on the graph correlate the dates of news articles.

Or view a comparison by comma separating search terms, ‘coke, pepsi‘ or ‘kfc, macdonalds‘.

Microsoft Virtual Labs

This rates as one of the handiest things I’ve seen in a while (okay I’m a geek). Say you feel like brushing up on some new Microsoft server/application – so you set up a VirtualPC and play with it there. Microsoft’s Virtual Labs have made this much much easier by setting up test environments for you which you can access via a web browser. I had a play with the “Introduction to Windows Server 2003 Management” tutorial – which allows you to switch between the four PCs being “virtualized” for the tutorial (domain controller, workstation, etc).

It looks like it all works around virtual servers hosted in Microsoft Virtual Server. Virtual servers can be viewed over the network via the ‘Virtual Machine Remote Control’ ActiveX control. You can view a virtual server which has it network connection intentionally “restricted” – something you couldn’t do with Remote Desktop. Thinking of hosting CruiseControl.net inside a virtual server at home – and adding a page to the CruiseControl webapplication with the VMRC ActiveX to jump onto the server.

Microsoft Virtual Server is now a free download. As are two VMWare products: Player and Server. VMWare also provide a directory of “pre-installed” virtual machines: Virtual Appliances. Looks like a very easy way to check out a Linux distro.