Bugs item #1185806, was opened at 2005-04-19 12:10
Message generated for change (Comment added) made by mguillem
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1185806&group_id=47038
Category: None
Group: 1.5
Status: Open
>
Resolution: Accepted
Priority: 5
Submitted By: BhupeshReddy (bhupeshreddy)
Assigned to: Nobody/Anonymous (nobody)
>
Summary: frame content should be loaded first when </frameset> found
Initial Comment:
The onLoad event on my page calls the hideLeftnav()
javascript function.
I am getting the following exception.
======= EXCEPTION START ========
EcmaError: lineNumber=[148] column=[0] lineSource=
[null] name=[TypeError] sourceName=
[/zpm/jscripts/navbar.js] message=[TypeError: Cannot
set property "cols" of null to "0,*"
(/zpm/jscripts/navbar.js#148)]
com.gargoylesoftware.htmlunit.ScriptException:
TypeError: Cannot set property "cols" of null to "0,*"
(/zpm/jscripts/navbar.js#148)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngin
e.callFunction(JavaScriptEngine.java:344)
Apparantly the function call getFrameset("bottom") is
returning null.
/**
* function called to hide the left nav bar
*
*/
function hideLeftnav() {
var bottom = getFrameset("bottom") ;
bottom.cols="0,*";
}
/**
* function called to access frame elements
*
*/
function getFrameset(aFrame) {
if (document.getElementById) {
elm = parent.document.getElementById(aFrame);
} else if (document.all) {
elm = parent.frames[1].document.all[aFrame];
} else if (document.layers) {
elm = parent.frames[1].document.layers[aFrame];
}
return elm;
}
the frameset code is as follows.
<frameset id="application" title="Application"
rows="60,0,*" framespacing="0" frameborder="1" >
<frame noresize id="navbar" name="navbar" src="<%
= navbar %>" marginwidth="0" marginheight="0"
scrolling="no" frameborder="0">
<frame noresize id="subnavbar" name="subnavbar"
src="subNavblank.jsp" marginwidth="0"
marginheight="0" scrolling="no" frameborder="0">
<frameset id="bottom" title="bottom" cols="<%=
bodysize %>" framespacing="0">
<frame class="leftNav" id="leftNav" name="leftNav"
noresize src="<%= leftnav %>" marginwidth="0"
marginheight="0" frameborder="0" scrolling="auto">
<frame class="workArea" id="workarea"
name="workArea" marginwidth="0" marginheight="0"
scrolling="auto" frameborder="0" src="<%= workarea %
>
">
</frameset>
</frameset>
----------------------------------------------------------------------
>
Comment By: Marc Guillemot (mguillem)
Date: 2005-04-28 21:37
Message:
Logged In: YES
user_id=402164
Htmlunit seems to wrongly load frame content too early,
before it finds the closing </frameset> tag.
The problem can be shown with simplier example (below).
Firefox and IE display alert with "true" whereas htmlunit
says "false".
I change the bug's title to better express the cause of the
problem.
<html>
<frameset rows="60,0,*">
<frame src="1.html">
<frame id="bottom" src="about:blank">
</frameset>
</html>
1.html:
<html>
<head>
<script>
function test()
{
alert(parent.document.getElementById('bottom') != null);
}
</script>
</head>
<body onload="test()" ></body>
</html>
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1185806&group_id=47038
-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!
http://www.idcswdc.com/cgi-bin/survey?id=105hix