Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change page in IFrame

Status
Not open for further replies.

dpdoug

Programmer
Nov 27, 2002
455
US
I have an IFrame on my main page. I can change the page displayed inside the Iframe from the main page, but what I want to do is to click on a button on a page that is displayed inside the iframe and change to a different page inside the iframe.

Does anyone know how to do this?
 
inside the iframe it would just be

location.href = "someNewPage.html";



=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
outside:
Code:
<script>
function page2(){
frames['ifrm'].location.href="page2.htm";
}
function page3(){
frames['ifrm'].location.href="page3.htm";
}
</script>
</head>
<body>
<iframe src="#" name="ifrm" id="ifrm"></iframe>
<button onClick="page2()">pg2</button> <div>
<button onClick="page3()">pg3</button>

hope this helps

__________________________________________________________
"The only difference between me and a mad man is that I'm not mad."
- Dali
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top