Forum Moderators: open

Message Too Old, No Replies

Back Button but without using IE History

Back without using history.back()

         

cunningmark

4:40 pm on Feb 3, 2005 (gmt 0)

10+ Year Member



I need to create a Back button, which would work the same as the history.back().
e.g.
<SCRIPT TYPE="text/javascript">
<!--
var bl = new backlink();
bl.type = "image";
bl.src = "gprevious.gif";
bl.text = "previous";
gb.write();
//-->
</SCRIPT>

Unfortuantly the sytem in need to create it on uses HTM Help, and has been heavily restriced.

Nav Bar disabled (browser back/forward disabled)
No print
No popup
No context (right click stuff)

With these chanes on is it still possible to mimic this action locally.
I.e. A Temp stack created and the top item called off when the prev/back button is hit.
With some sort of deletion in the stack to stop loops.

orion_rus

6:15 pm on Feb 3, 2005 (gmt 0)

10+ Year Member



I think without history u can do it only with server side scripting like php or aspx, if u interesting in it ask about it in a such forums)
Sorry) but i don't know other ways)

HughMungus

1:26 am on Feb 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure what your problem is and what I use is only slightly different:

<a onClick="javascript:history.go(-1);">

cunningmark

11:13 am on Feb 4, 2005 (gmt 0)

10+ Year Member



Tried that works on IE but not in the sytem I need it to work in.

The system has been restricted (across the network) by a No Nav Buttons restriction, a No print restriction, No Popup restriction and an No Context restriction all done in the registry of the closed Network.

This was done (by others) for security reasons to stop the access of the sysem behind the screens.

The only way I can think of this working is for the Pages to create there own (independent of History) Stack.

Something on the lines of:

as page opens it scans the stack if is not there already inserts itself at the top of the stack

When the previous/back button is pressed It goes to the previous entry in the stack and deletes itself from the stack

Bernard Marx

11:55 am on Feb 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the sytem in need to create it on uses HTM Help

Is this a CHM file?

Tried that works on IE but not in the sytem I need it to work in.

What system is that?

The system has been restricted (across the network) by a No Nav Buttons restriction, a No print restriction, No Popup restriction and an No Context restriction

None of this explicitly explains why
[blue]history.go(-1)[/blue]
doesn't work.

The only way I can think of this working is for the Pages to create there own (independent of History) Stack.

Creating your own history stack is possible. I have done it myself before for a framed system that was using location.replace() to navigate.
(The purpose of this was to provide normal history features whilst allowing the user to back straíght out of the site with the normal back button.)

However, each page having it's own stack doesn't make sense (to my ears). Unless you are using cookies, or passing info via urls.

Does the system have a constant top frame that can keep track of state?
If so, then it shouldn't be too hard.

cunningmark

1:22 pm on Feb 4, 2005 (gmt 0)

10+ Year Member



The system is a Till type system simmilar to that used in banks and shopping markets.

The HTML Help files are accessed from the normal system and give back up information about the product and services offered.
These systems are locked down tight so that the user cannot gain acces to the operating system etc.

Because of this lock down the Navigation controls Back, Next Home etc are disabled. There is no route to accessing the History file. Therefore a new one would need creating.

history.go(-1) and other history derigatives do not work.

This is not a framed system (frames also not supported)
Individual pages.

I would imagine each page having its own stack, but reffering to a single stack and adding/removing themselves as and when they are accessed. (there are over 2500 HTML files in this information resource site.

cunningmark

4:31 pm on Feb 7, 2005 (gmt 0)

10+ Year Member



Can some one help me I have tried several scripts to create my own history (which could then get tracked back) to no avail.

The constraints I am working in is that it can only be:
Javascript, JScript or VBScript. (No Pearl, PHP, SWT, JAVA, ASP etc).

Does someone has an example script, that I could use?

HughMungus

4:14 am on Feb 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What about getting the referer then making each "back" button customized for each visitor (you could even hide what the "back" URL is in the button if you have a db).

cunningmark

12:00 pm on Feb 21, 2005 (gmt 0)

10+ Year Member



found solution using frames:

Header.html points to header.js which would hold the array
HEADER.JS
var ahist = new Array();parent.main.focus();ahist.push("../index.html");
function moveForward(from,to)
{ahist.push(from);parent.main.location = to;}
function setActiveStyleSheet(title)
{var i, a, main;
for(i=0; a = parent.main.document.getElementsByTagName("link")[i]; i++)
{if(a.getAttribute("rel").indexOf("style")!= -1 && a.getAttribute("title"))
{a.disabled = true;}
if(a.getAttribute("title") == title) {a.disabled = false;}}}
function exitFromHelp()
{window.status='EG_ExitFromHelpToDesktop'}
on all links

<a style='cursor:hand' onclick='parent.header.moveForward(location.href,"YOURFILENAME.html")'>on back/previous button

<img style='cursor:hand' onclick='parent.main.location=parent.header.ahist.pop()' border="0" src="../images/previous.gif" border="0">