我遇到了页面重定向问题。我有一段代码在执行的某个阶段假设将页面重定向到其他地址。但由于某种原因,它没有。
由于某些原因,我必须使用 javascript,这是我使用的代码:
window.location.assign("http://www.myaddress.com")
完整代码:
<head runat="server">
<title>try mail</title>
<script type="text/javascript">
function openWin() {
myWindow = window.open('myaddressgoeshere', '', 'width=600,height=400');
myWindow.focus();
}
<body>
<form id="form1" runat="server">
<div>
<table width="300px" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> <img src="imagesNew/mail.jpg" width="75" height="52"/></td>
<td> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="center"><div id="signin"></div></td>
</tr>
</table>
</div>
</form>
<script type="text/javascript" language="javascript">
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');
}
}
</script>