在asp中使用JavaScript Timer [英] using JavaScript Timer in asp

查看:95
本文介绍了在asp中使用JavaScript Timer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站project.it是一个在线测验,它有一个javascript计时器,我想当计时器超时,一个注册数据库中的答案的按钮被自动点击并在数据库中注册我的答案,是任何解决我问题的机构?

i have a website project.it is an online Quiz,it has a timer in javascript,i want when the timer has time out,a button that regist answers in database be clicked automatically and regist my answers in data base,is any body to solve my problem?

推荐答案

你要的是用Javascript模拟按钮点击。



因此,当计时器超时时,您需要执行以下操作:

What you ask is to simulate a button click using Javascript.

So, you need to do something like below when the timer has timed out:
document.getElementById('btnSubmit').click();



这将触发btnSubmit的服务器端按钮单击事件 - 在此处编写与数据库相关的代码。


This will trigger server side button click event for btnSubmit - write your database related code here.


这篇关于在asp中使用JavaScript Timer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆