Window.onload

Hi,

I am trying to show a Tab based on IF the querystring value exists like this:


<?if ($_GET['ID'] != ''):?>
    <script language="text/javascript" type="javascript">window.onload="showTab4()"</script>
<?endif;?>

On this page:

http://www.freemanholland.com/about-us?ID=1

Notice the ?ID=1 is what i am checking for, so what i have managed to get working is change the selected tab which is latest news.

But the problem is that the content is wrong. IF you click on the latest news tab you will see the right content.

Any ideas what i’m doing wrong?

Thanks

Your function ShowTab4 is being executed to assign the return value to window.onload.

Remove the brackets, so you have window.onload=ShowTab4 and a reference to the function will be assigned to window.onload.

Thanks,

That worked perfectly.

:smiley: