bvtoffin
08-13-2004, 02:15 AM
Hi All,
I have a frameset with 2 frames as follows - mainFrame(top) and bottomFrame(bottom).
In the bottomFrame I have a link to open a new window - but I want to check what the URL is of the mainFrame (its a login page) to ensure they have logged in (ie not sitting on the login page).
I have tried the code below and different variations but can't get it to work (probably because I don't really know what I'm doing).
Nay help would be appreciated.
<html>
<head>
<script language="JavaScript">
function check(){
if (window.mainFrame.location.href = "http://testpage.jsp"){
alert("Please login to testpage first.");
}else{
return TRUE;
}
}
</script>
</head>
<body>
<table align="center" width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top" class="10bl">
<a href="default.asp" target="nnew" onClick="check()"><font class="10bl" ><b>Page to View</b></font></a>
</td>
</tr>
</table>
</body>
</html>
Cheers
I have a frameset with 2 frames as follows - mainFrame(top) and bottomFrame(bottom).
In the bottomFrame I have a link to open a new window - but I want to check what the URL is of the mainFrame (its a login page) to ensure they have logged in (ie not sitting on the login page).
I have tried the code below and different variations but can't get it to work (probably because I don't really know what I'm doing).
Nay help would be appreciated.
<html>
<head>
<script language="JavaScript">
function check(){
if (window.mainFrame.location.href = "http://testpage.jsp"){
alert("Please login to testpage first.");
}else{
return TRUE;
}
}
</script>
</head>
<body>
<table align="center" width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top" class="10bl">
<a href="default.asp" target="nnew" onClick="check()"><font class="10bl" ><b>Page to View</b></font></a>
</td>
</tr>
</table>
</body>
</html>
Cheers