Push - Pop stack problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ashes2Ashes
    New Member
    • Jan 2008
    • 3

    Push - Pop stack problem

    Hi,

    I've created a webpage where the user can enter an number/word into an address bar and it would appear somewhere else on the page - I also have back and forward buttons on the page (similar to a browser). But whenever i click the back or forwards button, instead of the last inputted number/word being popped back I get all of the words/numbers that have been inputted during that session. Anyone see where I'm going wrong?

    Heres my code for the back button:

    Code:
    		  function Go_Back (){
    
    		          var input2=navigation.url_out.value;
    
    		          url2.push(input2 + '\n');
    
    		          navigation.forward_stack.value=url2;
    
    
    		          var input1=navigation.back_stack.value;
    
    		          url1.pop();
    
    		          navigation.url_out.value=input1;
    
    		          }
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Show the corresponding HTML and the code that adds the inputs.

    Comment

    Working...