Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to redirect a page using javascript
    primarykey
    data
    text
    <p>I'm having troubles with a page redirection. I have a piece of code which on certain stage of execution suppose to redirect the page to other address. But for some reason it doesn't.</p> <p>For some reasons I have to use javascript and this is the code I used:</p> <pre><code>window.location.assign("http://www.myaddress.com") </code></pre> <p>the full code:</p> <pre><code>&lt;head runat="server"&gt; &lt;title&gt;try mail&lt;/title&gt; &lt;script type="text/javascript"&gt; function openWin() { myWindow = window.open('myaddressgoeshere', '', 'width=600,height=400'); myWindow.focus(); } </code></pre> <p> </p> <pre><code>&lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;table width="300px" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tr&gt; &lt;td&gt; &lt;img src="imagesNew/mail.jpg" width="75" height="52"/&gt;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2" align="center"&gt;&lt;div id="signin"&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/form&gt; &lt;script type="text/javascript" language="javascript"&gt; scope = ["wl.signin", "wl.basic", "wl.offline_access", "wl.emails", ], function id(domId) { return document.getElementById(domId); } WL.Event.subscribe("auth.sessionChange", function (e) { if (e.session) { displayMe(); authLogin(); } else { clearMe(); } } ); function authLogin(e) { if (e.status == 'connected') { WL.Event.unsubscribe("auth.login", authLogin); window.location.assign("http://www.hotmail.com"); WinJS.Navigation.navigate('files.html'); } } &lt;/script&gt; </code></pre> <p> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload