www.webdeveloper.com
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Posts
    2

    Question Forcing frames into a frameset

    Hi

    I'm hoping someone can help me decipher some code I have to force frames into a frameset! I'm fairly new to JavaScript and would appreciate a description of how the different parts of this code work.

    Code in the Frameset:
    <script language="JavaScript" TYPE="TEXT/JAVASCRIPT">
    var inframe = "TRUE";
    function lframe(){
    var loc = window.location;
    loc = loc.toString();
    loc = loc.toLowerCase();
    if (loc.indexOf("?") > 0) {
    var nPage = loc.substring((loc.indexOf("?") + 1), loc.length);
    window.mainFrame.location=nPage;
    } }
    </script>

    Code in individual frames:
    <script language="JavaScript" TYPE="TEXT/JAVASCRIPT">
    if (window.parent.inframe != "TRUE") {
    window.parent.location = "index.html?welcome.html" ;
    }
    </script>

    Thank you!
    Nic

  2. #2
    Join Date
    Mar 2003
    Posts
    2
    Hi Dave

    That's great, thank you.

    I don't suppose you'd explain to me how these two pieces of script work? (the new version for the frameset and the individual frame script). I currently know very little and am keen to understand as much as I can about what the script does!

    Nic

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



Recent Articles