Click to See Complete Forum and Search --> : Startpage issue


Bobby_S
12-14-2003, 05:01 AM
Weeee, great website I found here! Hope someone can help me with this one, cause it's really eating my nails over here (read: I can't solve it myself), and I think it's not hard to do:

we all know
<a href="javascript:;" onClick="javascript:this.style.behavior='url(#default#homepage)';this.setHomePage('http://bobby.com/')">Startpage</a>

This occurs when clicking on the url... now I wanna have it in a function [eg. onload()], so something like this:
<SCRIPT LANGUAGE="JavaScript">
<!--
function start() {
?????????
}
</SCRIPT>
<body onload="start()">

So it has to occur without a visitor-action...
You might think "don't do that, it's too ennoying", but I'm making sure it will only appear once (there some PHP in it too ...)

Thanks in advance!

- Bobby -

fredmv
12-14-2003, 01:24 PM
<script type="text/javascript">
//<![CDATA[
onload = function()
{
with(document.body)
{
style.behavior = 'url(#default#homepage)';
setHomePage('http://www.foo.com/');
}
}
//]]>
</script>

Bobby_S
12-14-2003, 01:45 PM
Great!
Thanks a lot!

fredmv
12-14-2003, 01:48 PM
You're very welcome. :D