Monday, 15 March 2010

jquery - Send value from Javascript to servlet -



jquery - Send value from Javascript to servlet -

hi have code here:

$(document).ready(function() { var clickcount = {} alist = document.getelementsbytagname('a') clickcounter = function() { clickcount[this.href] = clickcount[this.href] ? clickcount[this.href]+1 : 1; }

// event attached every link having "href" attribute

for (var i=0 ; i<alist.length, a=alist[i] ; i++) { if (this.href) { a.onclick = clickcounter; } }

i need send servlet can store value on database, found illustration php, don't know how servlet. , how can value servlet?

// illustration uses jquery send info php script // post request sent before window closed

onbeforeunload = function() { $.post('/tracking.php', clickcount); } }

the objective of program, count downloads , store in database using jsp.

javascript jquery html jsp servlets

No comments:

Post a Comment