HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Frame and back button problem
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame
View previous topic :: View next topic  
Author Message
Ladybiz



Joined: 12 Sep 2007
Posts: 5

PostPosted: Thu Sep 13, 2007 12:31 pm     Frame and back button problem Reply with quote

Hello. I am not sure if this question has been answered here in the forum or not. I have searched the iframes posts but have not found a solution to my problem.

I am not a professional web designer-so please be gentle when reviewing my code if you decide to help me out. Smile Also the site is not complete as I encountered this problem and wanted to fix it before completing all of the pages.

Here is the goal of the website design. I have created a "tour" of our company using frames. The menu buttons correctly open the pages within the iframe perfectly.

But here is where the problem comes in:
When you select a link on one of the pages within the iframe taking you to a new page and then click the "back button" on the browser, when you go to click the menu buttons again, the pages open in a new window. How can I prevent this from happening so that I can contain the 'tour' within one page (web browser)?

I will post the code for the welcome.htm page here, but if you would like the link to visit the site to see what I am talking about just let me know and I will either post it or send it by message through this forum.

Thanks very much in advance for any and all of your help.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Welcome to the AvivExpress!</title>
</head>
<body bgcolor="#FFFFFF" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" style="background-attachment: fixed; background-image:url('bg.gif')">
<center>
<table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#c0c0c0" width="750" id="AutoNumber1">
<tr>
<td width="100%">
<img border="0" src="avivheader.jpg" width="750" height="125"></td>
</tr>
<tr>
<td style="border: 2px solid #C0C0C0">






<html>
<head>
<title>newmenubar-sm.gif</title>

<meta http-equiv="Content-Type" content="text/html;">
<meta name="description" content="FW MX FP HTML">

<script language="JavaScript">
<!-- hide this script from non-javascript-enabled browsers

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// stop hiding -->
</script>
</head>

<body bgcolor="#ffffff" onload="">
<table border="0" cellpadding="0" cellspacing="0" width="750">
<!-- fwtable fwsrc="D:\Aviv Minerals\newmenubar-sm.png" fwbase="newmenubar-sm.gif" fwstyle="FrontPage" fwdocid = "742308039" fwnested=""0" -->
<script language="JavaScript">
<!-- hide
if (document.images) {
newmenubarsm_r2_c2_f2 = new Image(145 ,55); newmenubarsm_r2_c2_f2.src = "newmenubar-sm_r2_c2_f2.gif";
newmenubarsm_r2_c2_f1 = new Image(145 ,55); newmenubarsm_r2_c2_f1.src = "newmenubar-sm_r2_c2.gif";
newmenubarsm_r2_c4_f2 = new Image(145 ,55); newmenubarsm_r2_c4_f2.src = "newmenubar-sm_r2_c4_f2.gif";
newmenubarsm_r2_c4_f1 = new Image(145 ,55); newmenubarsm_r2_c4_f1.src = "newmenubar-sm_r2_c4.gif";
newmenubarsm_r2_c6_f2 = new Image(145 ,55); newmenubarsm_r2_c6_f2.src = "newmenubar-sm_r2_c6_f2.gif";
newmenubarsm_r2_c6_f1 = new Image(145 ,55); newmenubarsm_r2_c6_f1.src = "newmenubar-sm_r2_c6.gif";
newmenubarsm_r2_c8_f2 = new Image(145 ,55); newmenubarsm_r2_c8_f2.src = "newmenubar-sm_r2_c8_f2.gif";
newmenubarsm_r2_c8_f1 = new Image(145 ,55); newmenubarsm_r2_c8_f1.src = "newmenubar-sm_r2_c8.gif";
newmenubarsm_r2_c10_f2 = new Image(145 ,55); newmenubarsm_r2_c10_f2.src = "newmenubar-sm_r2_c10_f2.gif";
newmenubarsm_r2_c10_f1 = new Image(145 ,55); newmenubarsm_r2_c10_f1.src = "newmenubar-sm_r2_c10.gif";
}
// stop hiding -->
</script>
<tr>
<td><img src="spacer.gif" width="4" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="145" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="4" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="145" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="4" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="145" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="4" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="145" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="4" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="145" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="5" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>

<tr>
<td colspan="11"><img name="newmenubarsm_r1_c1" src="newmenubar-sm_r1_c1.gif" width="750" height="10" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="10" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2"><img name="newmenubarsm_r2_c1" src="newmenubar-sm_r2_c1.gif" width="4" height="65" border="0" alt=""></td>
<td><img name="newmenubarsm_r2_c2" src="newmenubar-sm_r2_c2.gif" width="145" height="55" border="0" usemap="#m_newmenubar-sm_r2_c2" alt=""></td>
<td rowspan="2"><img name="newmenubarsm_r2_c3" src="newmenubar-sm_r2_c3.gif" width="4" height="65" border="0" alt=""></td>
<td><img name="newmenubarsm_r2_c4" src="newmenubar-sm_r2_c4.gif" width="145" height="55" border="0" usemap="#m_newmenubar-sm_r2_c4" alt=""></td>
<td rowspan="2"><img name="newmenubarsm_r2_c5" src="newmenubar-sm_r2_c5.gif" width="4" height="65" border="0" alt=""></td>
<td><img name="newmenubarsm_r2_c6" src="newmenubar-sm_r2_c6.gif" width="145" height="55" border="0" usemap="#m_newmenubar-sm_r2_c6" alt=""></td>
<td rowspan="2"><img name="newmenubarsm_r2_c7" src="newmenubar-sm_r2_c7.gif" width="4" height="65" border="0" alt=""></td>
<td><img name="newmenubarsm_r2_c8" src="newmenubar-sm_r2_c8.gif" width="145" height="55" border="0" usemap="#m_newmenubar-sm_r2_c8" alt=""></td>
<td rowspan="2"><img name="newmenubarsm_r2_c9" src="newmenubar-sm_r2_c9.gif" width="4" height="65" border="0" alt=""></td>
<td><img name="newmenubarsm_r2_c10" src="newmenubar-sm_r2_c10.gif" width="145" height="55" border="0" usemap="#m_newmenubar-sm_r2_c10" alt=""></td>
<td rowspan="2"><img name="newmenubarsm_r2_c11" src="newmenubar-sm_r2_c11.gif" width="5" height="65" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="55" border="0" alt=""></td>
</tr>
<tr>
<td><img name="newmenubarsm_r3_c2" src="newmenubar-sm_r3_c2.gif" width="145" height="10" border="0" alt=""></td>
<td><img name="newmenubarsm_r3_c4" src="newmenubar-sm_r3_c4.gif" width="145" height="10" border="0" alt=""></td>
<td><img name="newmenubarsm_r3_c6" src="newmenubar-sm_r3_c6.gif" width="145" height="10" border="0" alt=""></td>
<td><img name="newmenubarsm_r3_c8" src="newmenubar-sm_r3_c8.gif" width="145" height="10" border="0" alt=""></td>
<td><img name="newmenubarsm_r3_c10" src="newmenubar-sm_r3_c10.gif" width="145" height="10" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="10" border="0" alt=""></td>
</tr>

<map name="m_newmenubar-sm_r2_c2">
<area shape="poly" coords="0,0,145,0,145,55,0,55,0,0" target="I1" href="AngelaNewAviv.swf" alt="" onMouseOut="MM_swapImage('newmenubarsm_r2_c2','','newmenubar-sm_r2_c2.gif',1);" onMouseOver="MM_swapImage('newmenubarsm_r2_c2','','newmenubar-sm_r2_c2_f2.gif',1);" >
<area shape="rect" coords="0,0, 145,55" href="#" onMouseOut="MM_swapImage('newmenubarsm_r2_c2','','newmenubar-sm_r2_c2.gif',1);" onMouseOver="MM_swapImage('newmenubarsm_r2_c2','','newmenubar-sm_r2_c2_f2.gif',1);" alt="">
</map>

<map name="m_newmenubar-sm_r2_c4">
<area shape="poly" coords="0,0,145,0,145,55,0,55,0,0" target="I1" href="products.htm" alt="" onMouseOut="MM_swapImage('newmenubarsm_r2_c4','','newmenubar-sm_r2_c4.gif',1);" onMouseOver="MM_swapImage('newmenubarsm_r2_c4','','newmenubar-sm_r2_c4_f2.gif',1);" >
<area shape="rect" coords="0,0, 145,55" href="#" onMouseOut="MM_swapImage('newmenubarsm_r2_c4','','newmenubar-sm_r2_c4.gif',1);" onMouseOver="MM_swapImage('newmenubarsm_r2_c4','','newmenubar-sm_r2_c4_f2.gif',1);" alt="">
</map>

<map name="m_newmenubar-sm_r2_c6">
<area shape="poly" coords="0,0,145,0,145,55,0,55,0,0" target="I1" href="rewards_chart.pdf" alt="" onMouseOut="MM_swapImage('newmenubarsm_r2_c6','','newmenubar-sm_r2_c6.gif',1);" onMouseOver="MM_swapImage('newmenubarsm_r2_c6','','newmenubar-sm_r2_c6_f2.gif',1);" >
<area shape="rect" coords="0,0, 145,55" href="#" onMouseOut="MM_swapImage('newmenubarsm_r2_c6','','newmenubar-sm_r2_c6.gif',1);" onMouseOver="MM_swapImage('newmenubarsm_r2_c6','','newmenubar-sm_r2_c6_f2.gif',1);" alt="">
</map>

<map name="m_newmenubar-sm_r2_c8">
<area shape="poly" coords="0,0,145,0,145,55,0,55,0,0" target="I1" href="#" alt="" onMouseOut="MM_swapImage('newmenubarsm_r2_c8','','newmenubar-sm_r2_c8.gif',1);" onMouseOver="MM_swapImage('newmenubarsm_r2_c8','','newmenubar-sm_r2_c8_f2.gif',1);" >
<area shape="rect" coords="0,0, 145,55" href="#" onMouseOut="MM_swapImage('newmenubarsm_r2_c8','','newmenubar-sm_r2_c8.gif',1);" onMouseOver="MM_swapImage('newmenubarsm_r2_c8','','newmenubar-sm_r2_c8_f2.gif',1);" alt="">
</map>

<map name="m_newmenubar-sm_r2_c10">
<area shape="poly" coords="0,0,145,0,145,55,0,55,0,0" target="I1" href="https://www.cs4000.com/avivnaturals/enroll/signup_form.asp?sponsorid=&sponsorname=" alt="" onMouseOut="MM_swapImage('newmenubarsm_r2_c10','','newmenubar-sm_r2_c10.gif',1);" onMouseOver="MM_swapImage('newmenubarsm_r2_c10','','newmenubar-sm_r2_c10_f2.gif',1);" >
<area shape="rect" coords="0,0, 145,55" href="#" onMouseOut="MM_swapImage('newmenubarsm_r2_c10','','newmenubar-sm_r2_c10.gif',1);" onMouseOver="MM_swapImage('newmenubarsm_r2_c10','','newmenubar-sm_r2_c10_f2.gif',1);" alt="">
</map>


</table></div>

</body>
</html>
</td>
</tr>
<tr>
<td width="100%" height="20" align="center" border="4" bordercolor="c0c0c0" bgcolor="#999966" style="border: 2px solid #C0C0C0">
<img border="0" src="wheat-slogan2.gif" width="750" height="25"></td>
</tr>
<tr>
<td align="center" width="100%" height="450" border="4" bordercolor="c0c0c0" bgcolor="#5AA5BC">
<br>
<iframe align="center" name="I1" width="95%" height="90%" marginwidth="1" marginheight="1" border="0" frameborder="0" src="AngelaNewAviv.swf">
Your browser does not support inline frames or is currently configured not to display inline frames.</iframe><br><br></td>
</tr>
<tr>
<td align="center" width="100%" bgcolor="#999966">
<div style="border-top-style: solid; border-top-width: 1; border-top-color: #c0c0c0; padding-top: 1">
<b>
<font color="#FFFFFF" face="Arial" size="2">Copyright 2007 AvivExpress. All rights Reserved.</font></b></div>
</td>
</tr>
</table>

</center>
</body>

</html>
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8205
Location: Castle Rock CO USA

PostPosted: Fri Sep 14, 2007 7:14 am     Re: Frame and back button problem Reply with quote



Ladybiz wrote:
But here is where the problem comes in:
When you select a link on one of the pages within the iframe taking you to a new page and then click the "back button" on the browser, when you go to click the menu buttons again, the pages open in a new window. How can I prevent this from happening so that I can contain the 'tour' within one page (web browser)?
Let's start to work from this quote... I click on a link and now I am in a new window. The back button should not be active since there is no history in this window.

But are you wanting the tour to open in the iframe?

If so, in your source code you closed the body element and then did something else. But you have
Code:
 <iframe align="center" name="I1" width="95%" height="90%" marginwidth="1" marginheight="1" border="0" frameborder="0" src="AngelaNewAviv.swf">
Your browser does not support inline frames or is currently configured not to display inline frames.</iframe>
You named this iframe is I1, so you need to target your links to this frame name
Code:
<a href="http://www.example.com" target="I1">Example</a>
First though, take a look at your code - everything you want to be displayed should be in the body element but you have closed some tags before after closing the body element which won't validate.

_________________
Corey
Toll Free Numbers for Real Estate Agents | Merchant Accounts
Ladybiz



Joined: 12 Sep 2007
Posts: 5

PostPosted: Fri Sep 14, 2007 8:35 am     Reply with quote

Hi Corey.

Thank you! I did not realize that I did not need that tag for the menu buttons. I enclosed the code for the menu buttons in separate body & html tags. I will remove these and see what happens. Thanks for the quick reply!
Ladybiz



Joined: 12 Sep 2007
Posts: 5

PostPosted: Sat Sep 15, 2007 11:37 pm     Reply with quote

Corey?

I cleaned up my coding as much as I could figure out and have all the pages up. But I am still having the same problem.

I don't think it has anything to do with the main webpage with the I1 frame. Beacue the problem happens after I press and link within the I1 frame and then use the back browser to navigate back (I know that this is not how I want people to navigate in the site, but I was troubleshooting for situations in which the back button would be used).

Everytime I click on the menu buttons after the back button has been used, the pages open in a new window instead of the I1 frame. Would you be willing to take a look at my site and see what I am talking about? I could really use your help.

I am trying to contain everything within one browser. This will eventually be a replicated site for other members to use so it is important that visitors not be able to navigate from the mainpage so as not to lose the replication coding (which will be added once tour site is complete). Right now it is on a shared server(godaddy) but once completed, will be moved to a semi-private server that the company uses to host the company website. I would rather not post the url here as it is not complete, but I understand that it would be helpful to others to see the solution. So you may post the code here if you want. If you would be willing to take a look at the site, please PM me and I will send the link.

Thanks in advance for your time and consideration.
~Ladybiz
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8205
Location: Castle Rock CO USA

PostPosted: Sun Sep 16, 2007 12:28 pm     Reply with quote

Ladybiz wrote:
Everytime I click on the menu buttons after the back button has been used, the pages open in a new window instead of the I1 frame. Would you be willing to take a look at my site and see what I am talking about? I could really use your help.
I would not recommend using (i)frames at all, for search engine purposes as well as navigation purposes.

If you are using frames to help maintain consistency and ease of updating, included content is what you need to consider instead. People will get the direct link and then they are stuck on one page if you are using frames.

Since you are using frames, you need to make sure that your <a> element has a target attribute
Code:
<a href="/default.asp" target="I1">Home</a>

_________________
Corey
Toll Free Fax Numbers | Mile High Merchant Accounts | LoudPCI
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial