Results 1 to 4 of 4

Thread: Pete

  1. #1
    Stop that Back Button! Guest

    Default Pete

    I&#039m busy writting a game for a bit of fun, but I&#039ve come across a bit of a prob. The game is turn based with every page being a different option for that turn. Everything works nice and dandy if I follow all the rules, but we all know what users are like, so I tried to find a few work around to messing up the game.<BR><BR>The biggest prob I have is the refresh and back buttons. Suppose you come to a page which gives you some ammo or some thing, the page increases you Session("Ammo") variable and awaits your next move. You hit the refresh button and get some more ammo and the page awaits your next turn, etc.<BR><BR>Or you might make a move and get killed, hit the back button and you can make a different move!<BR><BR>Any idea how to sort these out, I&#039ve read a bit about a piece of Javascript that does something with the back button what about refresh? <BR><BR>Also just how do I stop a page from refreshing, I&#039ve tried Response.Expire=0 but that does not seem to do anything!<BR><BR>Pete

  2. #2
    JEB Guest

    Default RE: Pete

    Not sure what you mean about preventing a page from refreshing. Response.expire=0 is supposed to tell the browser not to cache the page.. <BR> There is a javascript function along the lines of window.location.replace(url).. but.. I can&#039t remember the exact syntax.. and this only works with IE4 + .. not sure of netscape.<BR>This replaces the new page in the browser history.<BR>Hope this helps a little to solve your probs.

  3. #3
    omc Guest

    Default RE: Pete

    I just gave this suggestion to someone else on this board, but it might work for you too. You are going to have to experiment to see if this really works for you. You could try putting your game in a popup window that does not have any menu bar or history. You could call the new window with a script like this:<BR><BR>Function newwin()<BR>{<BR>open(&#039popup.html&#039, &#039new_window&#039,&#039toolbar=1,location=1,dir ectories=1,status=1,<BR>menubar=0,scrollbars=1,res izable=1,<BR>copyhistory=0,width=500,height=500&#0 39);<BR>}<BR><BR>The reason I am saying copyhistory=0 is because the user could right click on the screen and go back without having a menu bar. I am not sure, but I suspect that if you use copyhistory=0 they will not be able to do that. Again, you would have to experiment to see if this works because I have never used this for this particular purpose.

  4. #4
    Brad Foust Guest

    Default RE: Pete

    Here is the JavaScript that will take away the right click option:<BR><BR>function right(e) {<BR>var msg = "Sorry, you don&#039t have permission to right-click.";<BR>if (navigator.appName == &#039Netscape&#039 && e.which == 3) {<BR>alert(msg); // Delete this line to disable but not alert user<BR>return false;<BR>}<BR>else<BR>if (navigator.appName == &#039Microsoft Internet Explorer&#039 && event.button==2) {<BR>alert(msg); // Delete this line to disable but not alert user<BR>return false;<BR>}<BR>return true;<BR>}<BR>document.onmousedown = right;

Posting Permissions

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