Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3668350
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:06:43+00:00 2026-05-19T02:06:43+00:00

I am trying to force persistence on to a frameset – I want to

  • 0

I am trying to force persistence on to a frameset – I want to make it work so that the user is able to set his desired width (cols) for the frame and make sure the value is saved and loaded the other time the user accesses the page.

I am using this simple example page:

<html>
<head>
<script type="text/javascript">
function loadFrameWidth()
{
    document.getElementById('masterFrameset').cols = '150,*';
}

function storeFrameWidth()
{
 alert(document.getElementById('masterFrameset').cols);
}
</script>
</head>
<frameset id="masterFrameset" border="3" frameborder="1"
onLoad="loadFrameWidth()" onUnload="storeFrameWidth()">
  <frame id="controls" name="controlsFrame" src="about:blank" />
  <frame id="content" name="contentFrame" src="about:blank" />
 </frameset>
</html>

The problem that happens is that when I exit the page (the moment when it is “supposed” to store the width in a cookie) the “cols” value is not updated even if I have manually changed the width of the columns (via mouse).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:06:43+00:00Added an answer on May 19, 2026 at 2:06 am

    *** A WORKING SOLUTION ***

    <html>
    <head>
    <script type="text/javascript">
    <!--
    function loadFrameWidth(cookieName)
    {
        if (document.cookie.length>0)
     {
         c_start = document.cookie.indexOf(cookieName + "=");
      if (c_start != -1)
      {
       c_start = c_start + cookieName.length + 1;
       c_end = document.cookie.indexOf(";",c_start);
       if (c_end == -1) { c_end=document.cookie.length; }
       document.getElementById('masterFrameset').cols = unescape(document.cookie.substring(c_start,c_end));
      }
      else { setStandardWidth(); }
     }
     else { setStandardWidth(); }
    }
    
    function setStandardWidth()
    {
     document.getElementById('masterFrameset').cols = '150,*';
    }
    
    function storeFrameWidth(cookieName)
    {
     var currentCols = document.getElementById('masterFrameset').cols;
     var exdate = new Date();
     exdate.setDate(exdate.getDate() + 7);
     document.cookie = cookieName + "=" + escape(currentCols) + 
     ";expires=" + exdate.toUTCString();
    }
    -->
    </script>
    </head>
    <frameset id="masterFrameset" border="1" frameborder="1"
    onLoad="loadFrameWidth('frameSetWidth')" onUnload="storeFrameWidth('frameSetWidth')">
      <frame id="controls" name="controlsFrame" src="toc.html" />
      <frame id="content" name="contentFrame" src="content.html" />
     </frameset>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to make a make generic select control that I can dynamically add elements
I am trying to make a change at the auth.models.py file to force the
I'm trying to force Safari or IE7 to open a new page using a
I am playing with Microsoft's TreeView control and I am trying to force a
I was running some dynamic programming code (trying to brute-force disprove the Collatz conjecture
I'm trying to find a way to force Windows to reboot, and I am
I'm trying to use the MSBuild NUnit community task to force tests to run
Trying to find some simple SQL Server PIVOT examples. Most of the examples that
I'm trying to write my Domain Model as persistence-ignorant as possible . The only
Folks, we all know that IP blacklisting doesn't work - spammers can come in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.