I am using VS.NETJavascript code in the HTML page<script language="javascript"> function test() { // alert('working 1') document.location.href=('http://www.google.com'); // alert('after') }</script>I am calling this function in 2 ways 1. From the HTML page itself using,<input type="Button1" size="110" width="100" name="test" onclick="test();">2. From the .aspx.vb file,Button2.Attributes.Add("onclick", "java script:window.test();")When I click the Button1 the Google site is loaded, but when I click the Button2 the google site is not loaded and stays in the same page.When I uncomment the alert command the page is loaded for button2, only when i wait for the page to load and then give an OK for the alert.Is it the problem with time required for the page to load or whats wrong with the code...Why is this so????