Javascript

This is a discussion on "Javascript" within the JavaScript Forum section. This forum, and the thread "Javascript are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 17th, 2007, 06:48
New Member
Join Date: Oct 2007
Location: Chennai
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Javascript

How to disable the browser back and forward button
Reply With Quote

  #2 (permalink)  
Old Oct 17th, 2007, 06:52
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript

Javascript isn't really intended to control the browser functionality, it is to enhance the page for the user.

There is no way to disable the back button with javascript it requires javascript tricks which personally I can't stand if a site does this to me -- I find a site on Google, have a quick look and try click back only to be on the same page again grr
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
  #3 (permalink)  
Old Oct 20th, 2007, 21:31
Junior Member
Join Date: Nov 2006
Location: Los Angeles
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript

The back button is dependent on the browser's history object:
Code: Select all
window.history
but the history object is not writable for security reasons. You have three methods that can navigate to any node along the history object:
Code: Select all
window.history.forward();
window.history.back();
window.history.go(value);

window.history.go(-1); //equivalent to .back();
window.history.go(1); //equivalent to .forward();
The go method can also specify a URL, but it's only in relation to the children of the history object, not a redirect.

The back and forward button functionality can be extended to operate on asynchronous server requests (either through local anchor points or asynchronous buffering techniques like iframe or ajax) but cannot and SHOULD NOT be disabled.
Reply With Quote
  #4 (permalink)  
Old Oct 20th, 2007, 22:12
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript

Quote:
Originally Posted by dharvesh View Post
How to disable the browser back and forward button
Don't. Users will hate you, and designers will sneer at you.
Reply With Quote
  #5 (permalink)  
Old Oct 21st, 2007, 01:28
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript

Quote:
Originally Posted by MikeHopley View Post
Don't. Users will hate you, and designers will sneer at you.
I agree, this sort of thing would make me angrily punch my keyboard .
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
php and javascript yvettesio JavaScript Forum 8 Mar 14th, 2007 23:18
JavaScript cbrams9 JavaScript Forum 1 Sep 20th, 2006 17:35
using xml in javascript shailu JavaScript Forum 0 Jul 25th, 2006 07:36
Can someone help me with this javascript Galaxyblue JavaScript Forum 2 Mar 11th, 2004 12:18
what does \\ mean in javascript jenjen1018 JavaScript Forum 5 Jan 6th, 2004 17:05


All times are GMT. The time now is 22:43.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43