Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    New Coder
    Join Date
    Oct 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can I stop History from being recorded?

    How can I stop the user's browser from recording page accesses whilst moving round my site? Is there a 'magic' <meta tag for this ?

    Lesley

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's only one way, which is to replace *all* your links which javascript links in this form:

    document.location.replace("next_page.html");

    That will do it.

    But why do you want to? History is very useful for a surfer. Perhaps if you expand on the problems that history navigation is causing for your pages, and there may be a better solution to that.

  • #3
    New Coder
    Join Date
    Oct 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't want people to be able to 'start in the wrong place' by clicking a link out of sequence.

    Can you tell me how to use the javascript you suggest

    Can I just use it in a <a href .......>?

    and is it ok to use a target?

    Thanks Lesley

  • #4
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    Here is an example of a link. You just change the location of where you want to go.

    <a href="#" onClick='document.location.replace("wherever.htm")';>

    As for targeting, I'm sure you can, I'm just not sure right offhand.

  • #5
    New Coder
    Join Date
    Oct 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ta muchly !

  • #6
    Regular Coder
    Join Date
    Sep 2002
    Location
    Louisiana
    Posts
    576
    Thanks
    0
    Thanked 0 Times in 0 Posts
    or after ever link add this line
    <a href="link" onClick="document.history.length = 0">hi</a>

  • #7
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    i have a few thoughts on this:

    thought number one, is that this is not the right way to make sure that people start in the right place. this only ensures, that if the person has ever visited the site before, that they can not use their history to go back. it in no way stops them from following links, or from bookmarking it while they're there, and coming back that way.

    my second thought is this: if the person has this page in history, then that probably means that they already went through whatever steps you wanted, to get there. just as a completely random number, with no knowledge of your site, or the particulars, 65-70% of the visitors to any page on your site, will probably have already jumped through whatever hoops you wanted them to. do you really want to make them jump through those hoops a second time?

    my suggestion, rather than to destroy their visiting history, would be to set up a redirect, that checks for a cookie. no cookie, go directly to home page, do not pass go, do not see content. but if they do have the cookie, let them on through.

    just my thoughts on the subject
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #8
    New Coder
    Join Date
    Oct 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My thanks to ChrisMiceli for the alternative - I'll give it a go.

    John - This is a study course I am developing, which is also providing scientific statistics. I need to prevent people from passing on unauthorised copies.

    The links, which bother me are to pop-up pages which are purely temporary and created in response to a menu on a main page (which in turn is initially accessed via a password page).

    ie: password page >> main page >> popups

    The popups simply do not make sense or function correctly if accessed in isolation, since they incorporate information from the main page and from frequently updated .html files - so, in effect, I will be doing them a favour by removing them from the history!

    I need the user to enter only through the password page. Not only does it ID the user for me, but generates a function-less main page. Neither the 'main page' nor the 'popups' have any functions available and show only the title bar, so that the content cannot be copied OR recorded in any way. But if accessed from the history, all my careful planning goes up the spout, since pages are displayed with full browser functions.

    I have no problem with the main page, since it is a cgi link and I can incorporate a 'time-out', pushing the user back to enter their password.

    I think a cookie would only be half an answer, since some people could have the feature switched off. The password would not be a problem to my users, since I am recommending that they install Roboform - (which is an invaluable tool for form filling and remembering passwords, by the way.)

  • #9
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    ok, in your particular case, i agree. i was thinking more along the lines of those news magazines, that despise deep linking.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #10
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Easiest way to accomplish this
    Code:
    <script type="text/javascript">
    function doLink(e) {
        var a = (document.all) ? e.srcElement : e.target;
        if (a.href) {
            top.location.replace(a.href);
            return false;
            }
        return true;
        }
    <script>
    
    <body onclick="return doLink(event);">
    This way you won't have to touch each link individually, just add the onclick event to the BODY and you're set. All your links will now replace the current page in the history.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #11
    New Coder
    Join Date
    Oct 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Beetle

    That is the sort of thing I need because I am also using a menu system which allows me to use a script, but not add to a link.

    - but I either don't understand what it is supposed to do, or it isn't working.. (I put the / in the end script command, which I noticed was missing from your message)

    This is the way I have put it together:
    <HTML><HEAD><TITLE>Test</TITLE>
    <meta http-equiv="expires" content="0">

    <script type="text/javascript">
    function doLink(e) {
    var a = (document.all) ? e.srcElement : e.target;
    if (a.href) {
    top.location.replace(a.href);
    return false;
    }
    return true;
    }
    </script>
    </HEAD>
    <BODY onclick="return doLink(event);">
    <a href=test.html>Test</a>

    </BODY></HTML>


    I don't seem to get multiple history entries for the same page (which is nice) but I am still getting one entry per page, is that what you meant by replacing the current page - just that I don't get duplicates?

    What I am trying to do, is avoid certain pages from going into the history altogether.

    Also - if I can, with your help get that working, is it possible to include form submissions (which do not use <a href of course)

    Your help is most appreciated.

  • #12
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, I had to make one change to make it work with Netscape and Mozilla, but this does it for me
    Code:
    <html>
    <head>
    <title>test</title>
    <meta http-equiv="expires" content="0">
    
    <script type="text/javascript">
    function doLink(e) {
    	var a = (document.all) ? e.srcElement : e.target;
    	if (a.nodeType == 3) a = a.parentNode;
    	if (a.getAttribute('href')) {
    		top.location.replace(a.getAttribute('href'));
    		return false;
    		}
    	return true;
    	}
    </script>
    
    </head>
    
    <body onclick="return doLink(event);">
    
    <a href="temp.htm">Test</a>
    
    </body>
    </html>
    About the forms, uh, are you using POST or GET?

    Oh, and a note about the history.length idea that chrismiceli suggested: The length property of the history object is read-only, so attempting to set it equal to 0 will not work
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #13
    New Coder
    Join Date
    Oct 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Beetle

    Thank you so much for the effort on my behalf - it is still doing the same thing though. I copied your new text and pasted it into two simple html and linked one to the other, so I could toggle between them. Both had an entry in my history, which I deleted, tried again, and up they popped again !

    I'm using post by the way.

  • #14
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What browser are you using?
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #15
    New Coder
    Join Date
    Oct 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Beetle!

    I just got up ! It is 6.36 here in the UK.

    I am using IE v6.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •