JavaScript window.location is not working
<p>I don't seem to be able to get the JS window.location to work in my asp.net website.</p>

<pre><code>    &lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;script type="text/javascript"&gt;
        function Redirect(URL) {
            window.location.href = URL;
        }
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
    &lt;button id="test" title="test" onclick="Redirect('http://www.google.com');"&gt;click me&lt;/button&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>The button seems to do a postback instead.
Is my syntax wrong? I have tried window.location without href and same result.</p>