Home  >  Article  >  Web Front-end  >  js读取被点击次数的简单实例(从数据库中读取)_javascript技巧

js读取被点击次数的简单实例(从数据库中读取)_javascript技巧

WBOY
WBOYOriginal
2016-05-16 16:56:371325browse

是每次点击时获取一共点击了多少次是吧

1.可以再服务器端拖一个隐藏的隐藏的button控件,然后写button的Click事件,这个事件的作用是从数据库中调取一共被点击的次数。

2.把被点击的次数赋给一个隐藏的TextBox控件的Text属性。

3.在你的js函数validata()里触发服务器端的button控件的click事件
fuction validata()" { document.getElementById("Button1").click();
var num=Num(document.getElementById("TextBox1").value)+1; return num; }

4.num就是被点击图片的数量 我是用记事本写得,js函数错的自己调调

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn