JavaScript problem validating frame location

  • ahevans
  • Graduate
  • Graduate
  • ahevans
  • Posts: 181

Post 3+ Months Ago

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?


Code: [ Select ]
<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\">&lt;&lt; Previous</a> | Next &gt;&gt; </p>");
}
//-->
</SCRIPT>
  1. <SCRIPT language="JavaScript">
  2. <!--
  3. var message = "Error";
  4. function validateframe() {
  5.     if (parent.mainFrame.location.href == 'https://domain/SelfService.do?methodToCall=selfService&Update%20User=true')
  6.     {
  7.         message = "Please continue to <a href=\"https://domain2/login.asp\" target=\"_top\">log back in</a>.";
  8.     }
  9.     else
  10.     {
  11.         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.";
  12.     }
  13.     return message;
  14. }
  15. function output() {
  16.     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>");
  17.     document.write("<p>" + validateframe() + "</p>");
  18.     document.write("<p><a href=\"page4.html\">&lt;&lt; Previous</a> | Next &gt;&gt; </p>");
  19. }
  20. //-->
  21. </SCRIPT>
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 52 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.