易截截图软件、单文件、免安装、纯绿色、仅160KB

JavaScript连接SqlServer并实现分页(二)

//总记录数
function sumRecord()
{
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=test");
var sql = "select count(*) as RecordCount from baoming";
rs.open(sql,conn);
TotalRecords = rs('RecordCount');
}
function baoming()
{
//计算总的页数
TotalPages = (((TotalRecords % PageSize) == 0) ? (TotalRecords / PageSize)
: (TotalRecords / PageSize + 1));
//获取传参过来的页数
var toppage;
var home = Request.Form("home");
var up = Request.Form("up");
var uppage = parseInt(Request.Form("uppage"));
var down = Request.Form("down");
var downpage = parseInt(Request.Form("downpage"));

if(home=="首页")
{
CurPageNum = 1;
}else if(up=="上一页")
{
toppage = uppage;
//Response.Write("<mce:script type="text/javascript"><!--
alert('"+toppage+"');
// --></mce:script>");
CurPageNum = toppage-1;
//Response.Write("<mce:script type="text/javascript"><!--
alert('"+CurPageNum+"');
// --></mce:script>");
if(CurPageNum <= 0)
{
CurPageNum = 1;
}
}else if(down=="下一页")
{
toppage = downpage;
//Response.Write("<mce:script type="text/javascript"><!--
alert('"+toppage+"');
// --></mce:script>");
CurPageNum = toppage+1;
//Response.Write("<mce:script type="text/javascript"><!--
alert('"+CurPageNum+"');
// --></mce:script>");
if (CurPageNum >= TotalPages)
{
CurPageNum = TotalPages;
}
}
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=test");
var sql = "select top "+PageSize+" truename,activeid,chrtel,CONVERT(varchar(30),dtappenddate,20) as dtappenddate from baoming where id not in(select top "+(PageSize*(CurPageNum-1))+" id from baoming order


相关文档:

Google 排名中的 10 个最著名的 JavaScript 库

ugmbbc发布于 2009-11-14 09:41:43| 7628 次阅读 字体:大 小 打印预览
var ReTitle = '回复:Google 排名中的 10 个最著名的 JavaScript 库';
感谢COMSHARP CMS的投递
新闻来源:tripwiremagazine.com
JavaScript 是 Web 开发与设计中不可或缺的东西,不管是一个简单的网页还是一个专业的站点,也不管你是高手还是菜鸟 ......

Javascript拖拽&拖放系列文章1之offsetParent属性


这个系列文章主要是讲述实现Javascript拖拽功能的基础知识,并将在最后给出一个完整的示例。适合对拖拽完全不懂的人阅读。
第一篇就先讲讲Javascript中的offsetParent属性吧。
 
 
支持的浏览器:Internet Explorer 4.0+,Mozilla 1.0+,Netscape 6.0+,Opera 7.0+,Safari  ......

javascript+div+css滚动菜单的实现.

效果图
代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Scrollable</title>
<mce:script type="text/javascript"><!--
resizeCallback = function() {
......

javascript 调用 php 函数 模拟

<mce:script language=javascript><!--
var a=0;
// --></mce:script>
<?php
function func1()
{
$t="a=a+1;";
return $t."alert(a)";
}
?>
<?php
echo "<input type=button value='Sure' onclick=\"".func1()."\">";
?> ......

JavaScript连接SqlServer并实现分页

//总记录数
function sumRecord()
{
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=test");
var sql = "select count(*) as RecordCount from baoming";
rs.open(sql, ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号