Click to See Complete Forum and Search --> : problem in reloading the frame


durga
04-10-2003, 12:14 AM
Hi,
I've a question regarding frames.
In my application I've 2 frames which contain 2 jsp page.
When I resize the window (minimize or maximize) some of javascript functions written in the jsp pages not found.But when I click on page source option of browser it shows all the javascript functions.
And when I reload the page it works fine.

could you suggest something on this ?

Thanks in advance.

khalidali63
04-10-2003, 12:34 AM
Post a link to those pages or post your code so that some one can take a look.

Cheers

Khalid

durga
04-15-2003, 02:29 AM
I'm sending the code.

Main Page :

<HTML>
<HEAD>
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<TITLE>DYNAMIC BLOCK TIME TOOL</TITLE>
</HEAD>

<frameset rows="90,*" frameborder="0" border="0" framespacing="0">
<frame name="title" src="/jsp/TopFrame.jsp" framespacing="0" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" noresize>
<frame name="main" src="/jsp/Analysis.jsp" framespacing="0" frameborder="0" marginwidth="0" marginheight="0" noresize>
</frameset>

</HTML>

TopFrame.jsp :

<%@ page language="java" import="java.lang.*" %>

<HTML>
<HEAD>
<SCRIPT language="JavaScript">

normal1 = new Image();
normal1.src = "/images/Analysis1_test.gif";
highlight1 = new Image();
highlight1.src = "/images/Analysis2.gif";

normal2 = new Image();
normal2.src = "/images/Comparison1_test.gif";
highlight2 = new Image();
highlight2.src = "/images/Comparison2.gif";

normal3 = new Image();
normal3.src = "/images/Report1_test.gif";
highlight3 = new Image();
highlight3.src = "/images/Report2.gif";

normal4 = new Image();
normal4.src = "/images/Forecast1_test.gif";
highlight4 = new Image();
highlight4.src = "/images/Forecast2.gif";

normal5 = new Image();
normal5.src = "/images/Maintenance1_test.gif";
highlight5 = new Image();
highlight5.src = "/images/Maintenance2.gif";

function loadImg(num,obj)
{
var frm = document.frmTop;
frm.hidImgInd.value = num;

window.document.images[num+2].src = obj.src;
if(num == 1)
{
window.document.images[4].src = normal2.src;
window.document.images[5].src = normal3.src;
window.document.images[6].src = normal4.src;
window.document.images[7].src = normal5.src;
}
else if(num == 2)
{
window.document.images[3].src = normal1.src;
window.document.images[5].src = normal3.src;
window.document.images[6].src = normal4.src;
window.document.images[7].src = normal5.src;
}
else if(num == 3)
{
window.document.images[3].src = normal1.src;
window.document.images[4].src = normal2.src;
window.document.images[6].src = normal4.src;
window.document.images[7].src = normal5.src;
}
else if(num == 4)
{
window.document.images[3].src = normal1.src;
window.document.images[4].src = normal2.src;
window.document.images[5].src = normal3.src;
window.document.images[7].src = normal5.src;
}
else if(num == 5)
{
window.document.images[3].src = normal1.src;
window.document.images[4].src = normal2.src;
window.document.images[5].src = normal3.src;
window.document.images[6].src = normal4.src;
}
}

</SCRIPT>
</HEAD>

<BODY leftMargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="white">

<FORM name="frmTop" method="post" action="/jsp/TopFrame.jsp">

<INPUT type="hidden" name="hidImgInd" value="1">

<TABLE border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<TR bgcolor="#025C93">
<TD width="5%">
<IMG src="/images/Logo.gif">
</TD>
<TD width="10%">
<IMG src="/images/Title1.gif">
</TD>
<TD width="85%" align="center">
<IMG src="/images/Heading.gif">
</TD>
</TR>
<TR bgcolor="white">
<TD colspan="3" align="right">
<A href="javascript:alert('Application:under construction')">Print</A>
&nbsp;&nbsp;&nbsp;
<A href="javascript:alert('Application:under construction')">Export</A>
&nbsp;&nbsp;&nbsp;
</TD>
</TR>
</TABLE>


<TABLE cellPadding="0" cellSpacing="0" border="0" width="1000" align="center" bgcolor="white">
<TR>
<TD width="110" height="25">
<A href="/jsp/Analysis.jsp" target="main" onClick="loadImg(1,highlight1)">
<img src="/images/Analysis2.gif" border="0">
</A>
</TD>
<TD width="110" height="25">
<A href="/jsp/Comparison.jsp" target="main" onClick="loadImg(2,highlight2)">
<img src="/images/Comparison1_test.gif" border="0">
</A>
</TD>
<TD width="110" height="25">
<A href="/jsp/Report.jsp" target="main" onClick="loadImg(3,highlight3)">
<img src="/images/Report1_test.gif" border="0">
</A>
</TD>
<TD width="110" height="25">
<A href="/jsp/Forecast.jsp" target="main" onClick="loadImg(4,highlight4)">
<img src="/images/Forecast1_test.gif" border="0">
</A>
</TD>
<TD width="110" height="25">
<A href="/jsp/Maintenance.jsp" target="main" onClick="loadImg(5,highlight5)">
<img src="/images/Maintenance1_test.gif" border="0">
</A>
</TD>
<TD width="450" height="25">
&nbsp;
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>

When I'm resizing the window(minimize or maximize) it gives a javascript error :
loadImg is not defined.

Can anyone suggest a solution ?

Regards,
DP

durga
04-22-2003, 01:39 AM
Till now I'm not able to fix this bug.
Please help me out.

Regards,
DP