hi, I have created the following JavaScript to validate the location of another frame in my page. All files all on the same physical server and domain, but the frame set is hosted by IIS and the files within the frame I am validating are in Apache.
This solution works fine in Firefox, but not Internet Explorer. Can anyone see where I'm going wrong?
<SCRIPT language="JavaScript">
<!--
var message = "Error";
function validateframe() {
if (parent.mainFrame.location.href == 'https://domain/SelfService.do?methodToCall=selfService&Update%20User=true')
{
message = "Please continue to <a href=\"https://domain2/login.asp\" target=\"_top\">log back in</a>.";
}
else
{
message = "It appears you have not completed the tutorial, please <a href=\"https://domain/tutorial/\" target=\"_top\">start again</a> following the instructions given in the tutorial.";
}
return message;
}
function output() {
document.write("<p>If you need to reset a forgotten password you will be able to use the links available when attempting to log into online services.</p>");
document.write("<p>" + validateframe() + "</p>");
document.write("<p><a href=\"page4.html\"><< Previous</a> | Next >> </p>");
}
//-->
</SCRIPT>
- <SCRIPT language="JavaScript">
- <!--
- var message = "Error";
- function validateframe() {
- if (parent.mainFrame.location.href == 'https://domain/SelfService.do?methodToCall=selfService&Update%20User=true')
- {
- message = "Please continue to <a href=\"https://domain2/login.asp\" target=\"_top\">log back in</a>.";
- }
- else
- {
- message = "It appears you have not completed the tutorial, please <a href=\"https://domain/tutorial/\" target=\"_top\">start again</a> following the instructions given in the tutorial.";
- }
- return message;
- }
- function output() {
- document.write("<p>If you need to reset a forgotten password you will be able to use the links available when attempting to log into online services.</p>");
- document.write("<p>" + validateframe() + "</p>");
- document.write("<p><a href=\"page4.html\"><< Previous</a> | Next >> </p>");
- }
- //-->
- </SCRIPT>