js计时器 + asp 计时器
2024-08-29 04:20:45
JS:
<script type="text/javascript"> var counts = ;
function starts() {
if (counts == ) {
alert('已经开启了实时监控!')
return false; }
if (confirm("确定开启实时监控?")) {
setInterval("GetJSMapGps()", ); //15秒
counts = ;
return true; }
else return false; }
function dw() { appletFrame.s_locationSet(124.805832, 46.571381);
} function GetJSMapGps() { var gpsX;
var gpsY;
gpsX = window.document.getElementById("hdflog").value; //经度
gpsY = window.document.getElementById("hdflag").value; //纬度
if (gpsX != null && gpsX != "" & gpsY != null && gpsY != "") {
appletFrame.s_locationSet(gpsX, gpsY); } } </script>
asp:
protected void Timer1_Tick(object sender, EventArgs e)
{
string id = ViewState["mobileid"].ToString();
if (!string.IsNullOrEmpty(id))
{
DataTable dtGps = GBLL.GetList(" imei = '" + id + "' order by intime desc ").Tables[];
if (dtGps.Rows.Count > )
{
string lat = dtGps.Rows[]["lat"].ToString();
string lon = dtGps.Rows[]["lon"].ToString();
hdflog.Value = lon;
hdflag.Value = lat;
}
}
}
protected void timersWatch_Click(object sender, EventArgs e)
{
Timer1.Interval = * ;//10秒 开启计时器
}
最新文章
- java多线程实现方式
- 《连载 | 物联网框架ServerSuperIO教程》- 3.设备驱动介绍
- Supercell only provide the best games for players
- Arcgis for JS之Cluster聚类分析的实现(基于区域范围的)
- sql server中NULL导入decimal字段时报错
- Oracle数据库和MySQL数据库的不同之处
- SpringMVC3的ResponseBody返回字符串(JSON)乱码问题解决
- Android 高级UI设计笔记16:ViewStub的应用
- MySQL Server-id的作用
- 图片滚动js 实现图片无缝滚动
- MySQL(15):Select-distinct(返回非重复的记录)
- Css3做的旋转显示文字和角度的变化
- MySQL 存储过程创建表
- C# xml 读xml、写xml、Xpath、Xml to Linq、xml添加节点 xml修改节点
- ios &#160;调整 label 的字体行间距
- 高版本的jdk编译过的项目移到低版本的JDK的eclipse中出错的问题
- DMS路由表
- 十四年风雨路 苹果iMac电脑进化论
- 零基础学习openstack【完整中级篇】及openstack资源汇总
- border.css(解决移动端1px问题)