The COLS attribute incorrectly calculates the width of frames in Internet Explorer 8

Article translations Article translations
Article ID: 981303 - View products that this article applies to.
Expand all | Collapse all

On This Page

SYMPTOMS

You develop a webpage that uses the COLS attribute to set and retrieve the width of frames in a frameset. When you open this webpage in Windows Internet Explorer 8, the COLS attribute may incorrectly calculate the width of frames.

Note This problem occurs when you specify the width of frames in numbers of pixels. If you use percentage to specify the width of frames, this problem will not occur.

For a sample of code to reproduce this problem, see the "More information" section.

RESOLUTION

Security update information

To resolve this problem, install the most recent cumulative security update for Windows Internet Explorer. To do this, visit the following Microsoft website: 
http://update.microsoft.com
For more technical information about the most recent cumulative security update for Windows Internet Explorer, visit the following Microsoft website: 
http://www.microsoft.com/technet/security/current.aspx
Note This update was first included in security update 2360131 (MS10-071). For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2360131 MS10-071: Cumulative security update for Internet Explorer

MORE INFORMATION

Sample code to reproduce this issue

The following is an example of the code that you can use in a frame of a webpage to set and retrieve the width of the frame:
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>IE8 Frameset Cols Test</title>
<script type="text/javascript"> 
function get_col_width()
{
alert(parent.document.getElementById('ParentFrame').cols);
}
function set_col_width()
{
parent.document.getElementById('ParentFrame').cols = '100,*';
}
function set_col_width_pcnt()
{
parent.document.getElementById('ParentFrame').cols = '10%,*';
}
</script>
 </head>
<body>
<button onclick="get_col_width()">Get Col width</button>
<button onclick="set_col_width()">Set Col width to (100,*)</button>
<button onclick="set_col_width_pcnt()">Set Col width to (10%,*)</button>
</body>
</html>
In this example, you have the following three buttons:
  • The Get Col width button. You click this button to receive a message that shows the width of frames.
  • The Set Col width to (100,*) button. You click this button and then manually drag the frame splitter to set the width of frames in pixels.
  • The Set Col width to (10%,*) button. You click this button and then manually drag the frame splitter to set the width of frames in percentage.
However, you notice the following:
  • If you click the Set Col width to (10%,*) button and then drag the frame splitter, you receive the correct width of frames.
  • If you click the Set Col width to (100,*) button and then drag the frame splitter, you may receive the wrong width of frames.

For more information about the COLS attribute, visit the following Microsoft website:
Introduction to the COLS attribute
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Properties

Article ID: 981303 - Last Review: February 3, 2011 - Revision: 1.1
APPLIES TO
  • Windows Internet Explorer 8
Keywords: 
kbfix kbhotfixserver kbqfe kbsurveynew kbprb KB981303

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com