IE5+ Auto-Set Home Page

Microsoft Internet Explorer 6

For a company's internal environment where all users were using IE 6, I needed to offer one-click ability for users to update their Home page setting, due to an information-structure change in the company's intranet. I looked at various code examples for this, but all the samples I found on the Web either seemed to require having a link to click on, or they didn't work.

The Fix: 

Consider it another goofy design decision from Microsoft, but the trick to getting this to work is having an identifiable object -- any object -- on the page which can be used as a "launch pad" for establishing a DHTML behavior, upon which the setHomePage method can be called. (A better design decision, IMHO, would be to associate browser changes with the browser ["navigator"] object.) The countless online examples that show clickable text use a 'this' reference for the A tag as a way to get an identifiable object, but "click here to set this page as your Home page" looks cheesy and unprofessional. To have the user prompted as soon as the page is loaded (using the default verification prompt built into IE), use the following code:

<span id="oHomePage" style="behavior:url(#default#homepage);"></span>
<script language="JavaScript">
// -->

There are various ways you can dress this up, but this gets to the meat of it. Anyway, what makes this work (more smoothly than a "click here" link) is that you've created an invisible identifiable object as your launch pad for code that can fire as soon as the page loads.