Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2005, 08:48 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Refreshing frame.

Hi,
I have divide my page in two frames.
Now i want to refresh the content of topper frame while some action is carried out on other fram.

i m using this but not working:
--------
<script language="javascript">
 parent.TopFrame['TopFrame'].location.href = "msgcount.asp"
</script>
Please guide.


Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
 
Old October 20th, 2005, 11:52 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi Rupen !!
 use window.parent.topframename.location.href="urasppag e.asp";
 or
         window.parent.topframename.location.reload();
Hope this will help you.

Cheers :)

vinod
 
Old October 24th, 2005, 07:54 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

I tried both but not working. Any other way or what could be wrong?

here is the main page code:
----------------------------
<frameset rows="9,91" border="0" >
       <frame src="Msgcount.asp" name="TopFrame" noResize="true" scrolling="no" marginheight="0" marginwidth="0">
        <frame src="timesheet.asp" name="MainFrame" noResize="true" scrolling="yes" marginheight="0" marginwidth="0">
 </frameset>
</head>
<body onLoad="if(history.length>0)history.go(+1)">
</body>
----------------------------
so i use:
        <script language="javascript">
            //parent.TopFrame['TopFrame'].location.href = "msgcount.asp"
            //window.parent.TopFrame.location.reload();
            window.parent.TopFrame.location.href="msgcount.asp ";
        </script>
----------------------------


Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
 
Old October 27th, 2005, 01:59 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Rupen!!

Try this code
****test.html*****
<script>
function loadRefresh(frameid)
{
if(frameid==1)
{
window.parent.TopFrame.location.reload();
}
else
{
window.parent.TopFrame.location.href="t2.html"
}
}
</script>
<frameset rows="9,91" border="0" >
       <frame src="t1.html" name="TopFrame" noResize="true" scrolling="no" marginheight="0" marginwidth="0">
        <frame src="t2.html" name="MainFrame" noResize="true" scrolling="yes" marginheight="0" marginwidth="0">
 </frameset>
</head>
<body onLoad="if(history.length>0)history.go(+1)">
</body>

 ***************t1.html***************
<script>
function callParent(id)
{
 window.parent.loadRefresh(id)
}
</script>

First Frame Contents
<input type=button name=curr1 onclick="callParent(1)" value="Reload First Frame">
<input type=button name=curr2 onclick="callParent(2)" value="Reload Second Frame">

*******************t2.html*******************
<script>
function callParent(id)
{
 window.parent.loadRefresh(id)
}
</script>
<body onunload="alert('reload')">
Second Frame Contents
<input type=button name=curr1 onclick="callParent(1)" value="Reload First Frame">
<input type=button name=curr2 onclick="callParent(2)" value="Reload Second Frame">
</body>
*************

Note:-I have used alert message to show that function is called and page is reloaded again using reload() ,and location.href

Hope this will help you

Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set one frame src from other frame akumarp2p ASP.NET 1.x and 2.0 Application Design 2 March 13th, 2007 04:13 AM
parsing form data from frame to other frame audio-catalyst Classic ASP Basics 5 January 3rd, 2006 02:57 PM
Call right frame Page_Load event from left frame. ochanarachel Classic ASP Basics 0 January 28th, 2005 05:13 AM
refreshing XML withour refreshing the page sasidhar79 XML 1 January 12th, 2005 05:16 AM
Getting rid of click sound for refreshing frame cordel PHP How-To 4 March 29th, 2004 09:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.