Send data from javascript to a mysql database

前端 未结 3 2039
遇见更好的自我
遇见更好的自我 2020-11-29 07:52

I have this little click counter. I would like to include each click in a mysql table. Can anybody help?

var count1 = 0;
function countClicks1() {
count1 = c         


        
3条回答
  •  没有蜡笔的小新
    2020-11-29 08:20

    You will have to submit this data to the server somehow. I'm assuming that you don't want to do a full page reload every time a user clicks a link, so you'll have to user XHR (AJAX). If you are not using jQuery (or some other JS library) you can read this tutorial on how to do the XHR request "by hand".

提交回复
热议问题