日期:2014-05-16 浏览次数:20367 次
var task = {
run: function(){
Ext.fly('clock').update(new Date().format('g:i:s A'));
},
interval: 1000 //1 second
}
Ext.TaskManager.start(task);
<%@ page language="java" contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml2.dtd">
<html>
<head>
<script type="text/javascript" src="ext4/ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="ext4/resources/css/ext-all.css"/>
<script type="text/javascript">
Ext.onReady(function(){
var task = {
run: function(){
Ext.fly('clock').update(new Date().format('g:i:s A'));
},
interval: 1000 //1 second
}
Ext.TaskManager.start(task);
});
</script>
</head>
<body>
<div id="clock"></div>
</body>
</html>
Ext.fly('clock').update(new Date());
Ext.onReady(function () {
var task = {
run: function () {
Ext.fly('clock').update(Ext.Date.format(new Date(), 'g:i:s A'));
},
interval: 1000 //1 second
}
Ext.TaskManager.start(task);
});