javascript - Jquery modification to add 1 and save the number in a txt file on every click -
i using following click function purpose. can add add 1 in txt file when clicked? counter on how many times clicked.
thank you
$("#clearme").click(function(e) { e.preventdefault(); // have stuff here });
you can't access or edit files front-end. you'll need php or something. can save in variable , pass , process ajax. this, untested:
var num = 0; $button.click(function(){ $.ajax({ url: 'bla.php', type: 'post', data: { num: ++num } //... }); });
and in php:
$num = $_post['num']; // add file stuff
Comments
Post a Comment