clear history using javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neeleshv
    New Member
    • Aug 2010
    • 11

    #1

    clear history using javascript

    Hello i have to clear browser history ,I am using the following code(location.r eplace(this.hre f); return false;) but this is not working,Please help me on this,Or give me code.

    Thanks in advance.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    the JavaScript location object has nothing to do with the browser’s history.

    cited from MDC
    [the location object] contains information about the URL of the document and provides methods for changing that URL. You can also assign to this property to load another URL.
    you may happen to mean the history object.
    Last edited by Dormilich; Aug 27 '10, 08:40 AM.

    Comment

    • neeleshv
      New Member
      • Aug 2010
      • 11

      #3
      Thanks for reply,I know the history objects and its methods,I wants to clear the browser history,So can we do this ?Thanks for help.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        that is all discussed in the link I gave you.

        Comment

        • neeleshv
          New Member
          • Aug 2010
          • 11

          #5
          Thanks for reply,I know the history objects and its methods,I wants to clear the browser history,So can we do this? Thanks for help.

          Comment

          • neeleshv
            New Member
            • Aug 2010
            • 11

            #6
            Yes,But i knew earlier,Please help me on clearing the browser history.

            Comment

            • omerbutt
              Contributor
              • Nov 2006
              • 638

              #7
              if you are trying to restrict the usear from going back then you can use this
              [CODE=javascript]
              <script language="javas cript" >
              history.go(1); /* undo user navigation (ex: IE Back Button) */
              </script>
              [/CODE]
              As for the original question... no, you can't delete/change/etc files that are on the users' computers. Simple as that.

              You could do a cookie/IP/session/etc tracking with server or client side programming, or try what twey suggested.

              Comment

              • neeleshv
                New Member
                • Aug 2010
                • 11

                #8
                Thank u so much omerbutt.

                Comment

                • omerbutt
                  Contributor
                  • Nov 2006
                  • 638

                  #9
                  did that solved your problem

                  Comment

                  Working...