Log in

View Full Version : Browser Back button



SameerMirza
04-06-2009, 04:41 PM
Hi all,

I am fairly new to web-development. While developing an internal web-site i created two pages with menu, one of them is parent menu page (left menu) which nevigates to the another page with tree menu.

Problem is that I couldn't show the page with tree menu as part of the master frame i.e where the other pages normaly appear, so I set the target = _top. This means that the page with tree menu actually takes place of the parent page. Now when I click back it doesn't go to the parent page but stay on the same page.

Does any one know a good solution to this apart from the home button that I created, which navigates to the parent page?

It will be great if some one could tell the way to go back to the home page using the standard browser back button.


Regards,

Sameer.

The Red
04-06-2009, 06:05 PM
Will you post a link to your page?

SameerMirza
04-07-2009, 10:46 AM
I dont think I can as it is an internal web, not access-able externaly atleast I dont know the way. :/ but as I mentioned the tree menu page actually comes on top of the home page. I am not 100% sure but i think it has somthing to do with it that I cant use the back button to get back to home page.

SameerMirza
04-08-2009, 12:27 PM
I dont think I can as it is an internal web, not access-able externaly atleast I dont know the way. :/ but as I mentioned the tree menu page actually comes on top of the home page. I am not 100% sure but i think it has somthing to do with it that I cant use the back button to get back to home page.

Any idea guys? It is realy urgent for me, it will be great if some one could help me out with it.

ganeshseo
04-09-2009, 07:10 AM
You try to give a link to your page

ganeshseo
04-09-2009, 07:11 AM
Also You try this

<a href='javascript:history.back()'>back</a>

This is history back process.

SameerMirza
04-09-2009, 08:49 AM
Hi there,

I wish I could send you the link. I asked some one in the team if it was possible but i guess not. I can explain the seranrio again. Basically I was trying to nest a tree menu in a standard left menu which i dont think is possible or even if it is, may not look pretty. So i decided to paste the link to the tree menu page in left menu. It wouldn't look good to open a menu in master frame so set the target = _top.

To be honest this is my first web and I am not even sure that wether my idea of menu is good or not. :confused:

I will be glad if some one could help me out.

Thanks,

Sameer.

AdrielGreene
04-10-2009, 03:47 AM
<a href=\"#\" onclick=\"history.back();\">GO BACK!</a>

amutha
04-10-2009, 09:42 AM
you may give the url of site.........

SameerMirza
04-14-2009, 09:33 AM
Thanks Adriel but as I have mentioned, I have created one back button but the Goal is to make the default browser back button to work.
amutha- I know it would have been much easier if I could paste the link but it is not allowed and doesn't work either as it is an internal web.
I don't realy know what information I can provide to help you guys answer.

SameerMirza
04-14-2009, 12:26 PM
hi all,

Here is part of the leftmenu code that I am using, trick is in the <a> tag where I am saying target = _top.

<div class='menu' onclick="SwitchMenu('sub1')"><img style='vertical-align: middle' width=20 height=20 src='html/icons/txtmenu.gif' border=0 hspace=3>Tree menu</div>
<span class='options' id='sub1'>
<div class='option' onmouseover="this.style.background='#D8E4F8'" onmouseout="this.style.background='#f5f5f5'">
<a href='http://dash/index_tree.html' target = '_top'><img style='vertical-align: middle' width=16 height=16 src='html/icons/txtfolder.gif' border=0 hspace=3>Tree</a></div>


Idea is to open the tree menu page on top of the home page. When i keep the same page i.e http://dash/index_tree.html the browser back button doesn't take me back once on index_tree.html however if I open any .php page from the same <a> link it works fine.

Can any one think of a reason? :confused:

SameerMirza
04-16-2009, 09:30 AM
Any ideas about the above post guys?

SameerMirza
04-21-2009, 04:36 PM
Hi all,

I just want to simplify the question here because I just looked at my home page which is based on frames aswell and back button isn't working on it either. So it definalty to do with frames. I can't get rid of frames for the following reasons,

- I got tree menu in one of the pages which goes upto third child lelvel and requires the frame resize (if required by user).

- to open the link in another frames (basic frames funcationality, which can be achieved by iframes but that wouldn't allow the resize of frames)

So, Does any one know how to deal with back button while working with frames. Here is simple code that I am using for the home page,


</head>

<frameset framespacing="0" rows="106,*">
<frame name="top" src="top_time.php" frameborder="0" border = "false" marginwidth="0" marginheight="0" framespacing="0" scrolling="no" >

<frameset framespacing="10" frameborder="10" bordercolor = "Gray" cols="170,*">
<frame name="menu" src="leftmenu.htm" frameborder="5" bordercolor = "gray" marginwidth="0" marginheight="0" framespacing="0" scrolling="no" >
<frame name="master" src="master.html" frameborder="0" marginwidth="0" marginheight="0" framespacing="0" scrolling="yes" >
</frameset>

<noframes>
<body bgcolor="#FFFFFF">
<br><br><center>
<h1>No Frames!</h1>
<h4>No frames in your browser!</h4>
</center></body>
</noframes>
</frameset>

</html>

It will be great if some one could solve this one for me. Realy urgent :(

vincentvu
05-16-2009, 11:06 PM
I think this should be the correct code for going back to last page: "javascript:history.goBack(-1);"