Solved

refresh frame in html

Posted on 2010-11-15
2
710 Views
Last Modified: 2012-05-10
Dear Expert,

I have one simple question  that is  I have two frame, one frame is with inputbox
and second frame is my redirect URL webpage and I set its default URL like www.yahoo.com
and  second frame will redirect to my targe URL after I input correct value or address name in the inputbox
The question is after I redirect to my tagerat second frame URL like www.experts-exhange.com successfully
but I can NOT go back to my default page,www.yahoo.com when clicking refresh button right next to IE window address bar  OR even I click adress bar and enter again, and the second frame webpage is still stay on www.expert-exchange.com. Why ?
As I know, when click the refresh button, it will go back to www.mywebiste.com/index.html 
since URL in address bar at IE is still http://www.mywebsite.com and no change at all
and second frame in my index.html  will should go back to its default URL, www.yahoo.com


Is it related to refresh,reload , onload issue ? Please advise and attach simple index.html code


**********www.mywebiste.com/index.html
<html>
<frameset rows="135,*" cols="*">
<frame id="inputFrame" name="inputFrame" frameborder="no" scrolling="NO" src="/inputboxframe.html">
<frame name="secondFrame"   marginwidth=0 marginheight=0  src="http://www.yahoo.com"  frameborder="no"  >
</frameset>
</html> 

******Inputboxframe.Html
<html>
<script type="text/javascript">
function checkEnter(e, el,fn) {
    var key=e.keyCode || e.which;
    if (key==13){
       fn();
el.value='';
return false;
    }
    return true;
}
function formSubmit() {
var my_val = document.getElementById('text1').value;
parent.secondFrame.document.location.href="http://www."+ my_val + ".com ";}
<script type="text/javascript">
<body>
<input   id="text1" value='' onclick="this.value=''; this.className='highlighted'" 
 onblur="if(this.value=='')this.value=this.defaultValue; this.className=''"
onkeydown="return checkEnter(event, this,formSubmit);"  >
<input type="button"  value="submit" onclick="formSubmit();" />
</body>
</html>

Open in new window

0
Comment
Question by:duncanb7
2 Comments
 
LVL 20

Accepted Solution

by:
Proculopsis earned 250 total points
ID: 34135699

In you input frame have an onload event that will force secondFrame to load your initial web site.

Something like:

<body onload="doThis">

function doThis()
{
  parent.secondFrame.document.location.replace( "http://w3c.org" );
}

Open in new window

0
 
LVL 13

Author Closing Comment

by:duncanb7
ID: 34136866


I change to onload="dothis"
to noload="dothis();"
it works finally

Thanks for your help
Duncan
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Passport Expiry 3 44
Help with removing item from Session Array 3 23
Can't get container centered 4 12
tiny glitch in my main slider 3 20
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question