时间跳转和自增
来源:互联网 发布:网络拓扑发现开源软件 编辑:程序博客网 时间:2024/05/06 06:54
时间跳转:
<span id="time" style="background:red">5</span>秒钟后自动跳转,如果不跳转,请点击下面链接
<script language="JavaScript1.2" type="text/javascript">
<!--
// Place this in the 'head' section of your page.
function delayURL(url) {
var delay = document.getElementById("time").innerHTML;
//alert(delay);
if(delay > 0) {
delay--;
document.getElementById("time").innerHTML = delay;
} else {
window.top.location.href = url;
}
setTimeout("delayURL('" + url + "')", 1000); //delayURL(http://wwer)
}
自增id:
Connection conn = DB.getConn();
boolean autoCommit = conn.getAutoCommit();
conn.setAutoCommit(false);
int rootId = -1;
String sql = "insert into article values (null, ?, ?, ?, ?, now(), ?)";
PreparedStatement pstmt = DB.prepareStmt(conn, sql, Statement.RETURN_GENERATED_KEYS);
pstmt.setInt(1, 0);
pstmt.setInt(2, rootId);
pstmt.setString(3, title);
pstmt.setString(4, cont);
pstmt.setInt(5, 0);
pstmt.executeUpdate();
ResultSet rsKey = pstmt.getGeneratedKeys();
rsKey.next();
rootId = rsKey.getInt(1);
Statement stmt = DB.createStmt(conn);
stmt.executeUpdate("update article set rootid = " + rootId + " where id = " + rootId);
conn.commit();
conn.setAutoCommit(autoCommit);
DB.close(pstmt);
DB.close(stmt);
DB.close(conn);
- 时间跳转和自增
- Oracle插入自增和当前时间
- 第九周 项目2--时间对象的自增和自减以及<<和>>的重载
- Activity跳转和时间工具类
- 倒计时跳转和获取实时时间
- [时间序列分析][3]--自相关系数和偏自相关系数
- 自增“++”和自减“--”
- 自增和自减
- js实现页面刷新和跳转(指定时间)
- thinkphp方法success和error跳转时间以及返回ajax
- oracle 创建固定长度的自增ID 和 当前时间
- oracle 创建固定长度的自增ID 和 当前时间
- mysql自增ID默认时间
- 指定时间,跳转页面
- 延时时间跳转代码
- C/C++中的日期和时间 (转自zhanjun.net)
- 网页显示服务器时间和javscript自运行时钟
- Android自带的时间空间和日期控件
- pthread_join
- 计算字符串的相似度(VB2005)——思索之三
- Axis2与Eclipse整合开发Web Service之一
- Struts 2中实现文件上传
- 我的身体为什以会这样?如何诊治?
- 时间跳转和自增
- linux上的汇编语言入门
- 誕生日
- linux下设置线程优先级
- 第一个Windows API程序
- const修饰符可以区分重载函数
- 强大的jquery,再次让我为之鼓掌——三维展示插件
- SAP Joke
- 关于误差积累