Useful JavaScripts

If you have any comments or suggestions, please send them to Kai.Nikulainen@sci.fi.

Opening a random startpage

If you have several starting pages you would like to alternate, the script below is your answer. It randomly chooses one of the locations whenever you press Home or start your browser. Either copy it to a text-file called RandomStart.html or use the right-button menu to download the file. Note: Left-clicking on the link executes the script!

<html><head><script>
//// Add your starting locations below
var urls=new Array("http://dailynews.yahoo.com/", "http://mrshowbiz.go.com/", "http://www.gossamer.org/")
//// Leave the rest of the file unchanged

self.location=(urls[Math.floor(Math.random()*urls.length*0.99)])
</script></head><body></body></html>

After you have RandomStart.html on your computer, you need to change the preferences of your browser so that RandomStart.html is your new starting page. If you want to add or change the locations, just edit the file with a text editor.

Opening several startpages at once

If you want to open several startpages instead of just one, try the following script. Either copy it to a text-file called MultiStart.html or use the right-button menu to download the file. Note: Left-clicking on the link executes the script!

<html><head><script>
//// Add your starting locations below
var urls=new Array("http://dailynews.yahoo.com/", "http://mrshowbiz.go.com/", "http://www.gossamer.org/")
//// Leave the rest of the file unchanged

var i
self.location=(urls[0])
for (i=1;i<urls.length;i++) window.open(urls[i]);
</script></head><body></body></html>

After you have MultiStart.html on your computer, you need to change the preferences of your browser so that MultiStart.html is your new starting page. If you want to add or change the locations, just edit the file with a text editor.

Return to my homepage