• Post Reply Bookmark Topic Watch Topic
  • New Topic

tracking clicks across requests

 
Anant Rao
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was not sure where to place this post in javascript or jsp

i have page with 2 buttons with Next and previous and have to keep count how many times I have clicked on these buttons in a variable. And everytime I click on the button the page get reloaded. I tried using javascript and assiging global varible in Javascript but as the page gets reloaded everytime the value is setting back to Zero.

Could anyone suggest me if there is any other way I could keep track of the button clicks.

Thanks
infyniti

[ November 16, 2007: Message edited by: infyniti Jenn ]
[ November 16, 2007: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"infyniti Jenn",
Please check your pryvate messages
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65529
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

I have adjusted the subject of this post for you.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65529
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obviously you aren't going to be able to do this with JavaScript as page-global variables get reloaded with every new request. You'll need to store it on the server. The session might be a good place to contemplate.
 
Anant Rao
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I took a hidden variable to count no of clicks. But if we click next the count should decrement and prevous should increment. So a track should be kept which button is clicked, which i am not able trace

javascript

similary for next its + 1

But everytime the page count is increment and its counting the clicks

Any help?




[BSouther: Added UBB CODE tags]
[ November 16, 2007: Message edited by: Ben Souther ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65529
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read Ben's private message?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!