By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,949 Members | 2,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,949 IT Pros & Developers. It's quick & easy.

Push - Pop stack problem

P: 3
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:

Expand|Select|Wrap|Line Numbers
  1.           function Go_Back (){
  2.  
  3.                   var input2=navigation.url_out.value;
  4.  
  5.                   url2.push(input2 + '\n');
  6.  
  7.                   navigation.forward_stack.value=url2;
  8.  
  9.  
  10.                   var input1=navigation.back_stack.value;
  11.  
  12.                   url1.pop();
  13.  
  14.                   navigation.url_out.value=input1;
  15.  
  16.                   }
Jan 16 '08 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Show the corresponding HTML and the code that adds the inputs.
Jan 16 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.