Disable Forward & Back Navigation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gyanendar
    New Member
    • Jun 2007
    • 90

    Disable Forward & Back Navigation

    Hi All,
    I need to disable the BACK & Forward Navigation of Browser toolbar for my application .Please help me how to do it.
    Regards
    Gyanendar
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    have a look at the answer here

    kind regards

    Comment

    • gyanendar
      New Member
      • Jun 2007
      • 90

      #3
      Originally posted by gits
      have a look at the answer here

      kind regards
      Thanks for the reply.

      Any way my main requirement was if I can't disable it than hide the toolbar for application.
      So, I open the application by using window.open() in first page and close the opner.
      Regards,
      Manohar

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        yes ... that would be one of the workarounds ... did you check whether the backspace-key might make a problem ... be sure to have no control focused in your page and press backspace ... usally that triggers the back-action ... ynd you may want to suppress that event?

        kind regards

        Comment

        • gyanendar
          New Member
          • Jun 2007
          • 90

          #5
          Originally posted by gits
          yes ... that would be one of the workarounds ... did you check whether the backspace-key might make a problem ... be sure to have no control focused in your page and press backspace ... usally that triggers the back-action ... ynd you may want to suppress that event?

          kind regards
          Yes.. by pressing backspace ,back-action event is triggered.Prese ntly I m not able to suppress the event.
          It will be nice ,if I am able to do so ,

          Regards,
          Manohar

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            ok ... :) let me give you an example to avoid that in firefox/mozilla:

            [CODE=javascript]var event_keypress = function(e) {
            var whitelist = { 'input': 1, 'textarea': 1 };
            var target_n = e.target.tagNam e.toLowerCase() ;

            if (e.keyCode == 8 && !(target_n in whitelist)) {
            e.preventDefaul t();
            }
            }

            document.addEve ntListener('key press', event_keypress, true);
            [/CODE]
            this has to be adapted for IE which uses attachEvent() instead of addEventListene r() ...

            kind regards

            Comment

            Working...