本邮件内容由第三方提供,如果您不想继续收到该邮件,可 点此退订 。
Jscript复选框 - 健康生活吧 阅读原文»
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<script type="text/javascript">
<!--全选框的方法-->
function check(object){
var checks=document.getElementsByName("checks");
if (checks!=null)
{
for (var i=0;i<checks.length;i++ )
{
checks.checked=document.getElementById("checkAll").checked;
}
}
};
<!--这里要注意如果 var checkall=document.getElementById("checkAll").checked; 下面判断 checkall==true 语句是错的!逻辑是对的,语法是错的-->
function checks(){
var checkall=document.getElementById("checkAll");
var checks=document.getElementsByName("checks");
var count=0;
var sum=0;
for (var i=0;i<checks.length ;i++ )
{
if (checks.checked==true)
{
count=count+1;
}
if(checks.checked==false){
sum=sum+1;
}
}
alert(sum);
if (count==checks.length)
{
checkall.checked=true;
}
if (sum>0)
{
if (checkall.checked==true)
{
checkall.checked=false;
}
}
}
</script>
</head>
<body>
<div id="" class="">
<table>
<tr>
<td><input type="checkbox" id="checkAll" onclick="check(this)"></td>
<td>商品名称</td>
<td>商品价格</td>
<td>商品描述</td>
</tr>
<tr>
<td><input type="checkbox" name="checks" onclick="checks()"></td>
<td>酒精</td>
<td>12</td>
<td>酒精你懂的</td>
</tr>
<tr>
<td><input type="checkbox" name="checks" onclick="checks()"></td>
<td>饭盒</td>
<td>15</td>
<td>吃饭的工具,你不知道?</td>
</tr>
<tr>
<td><input type="checkbox" name="checks" onclick="checks()"></td>
<td>酒精</td>
<td>12</td>
<td>酒精你懂的</td>
</tr>
<tr>
<td><input type="checkbox" name="checks" onclick="checks()"></td>
<td>饭盒</td>
<td>15</td>
<td>吃饭的工具,你不知道?</td>
</tr>
<tr>
<td><input type="checkbox" name="checks" onclick="checks()"></td>
<td>酒精</td>
<td>12</td>
<td>酒精你懂的</td>
</tr>
<tr>
<td><input type="
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<script type="text/javascript">
<!--全选框的方法-->
function check(object){
var checks=document.getElementsByName("checks");
if (checks!=null)
{
for (var i=0;i<checks.length;i++ )
{
checks.checked=document.getElementById("checkAll").checked;
}
}
};
<!--这里要注意如果 var checkall=document.getElementById("checkAll").checked; 下面判断 checkall==true 语句是错的!逻辑是对的,语法是错的-->
function checks(){
var checkall=document.getElementById("checkAll");
var checks=document.getElementsByName("checks");
var count=0;
var sum=0;
for (var i=0;i<checks.length ;i++ )
{
if (checks.checked==true)
{
count=count+1;
}
if(checks.checked==false){
sum=sum+1;
}
}
alert(sum);
if (count==checks.length)
{
checkall.checked=true;
}
if (sum>0)
{
if (checkall.checked==true)
{
checkall.checked=false;
}
}
}
</script>
</head>
<body>
<div id="" class="">
<table>
<tr>
<td><input type="checkbox" id="checkAll" onclick="check(this)"></td>
<td>商品名称</td>
<td>商品价格</td>
<td>商品描述</td>
</tr>
<tr>
<td><input type="checkbox" name="checks" onclick="checks()"></td>
<td>酒精</td>
<td>12</td>
<td>酒精你懂的</td>
</tr>
<tr>
<td><input type="checkbox" name="checks" onclick="checks()"></td>
<td>饭盒</td>
<td>15</td>
<td>吃饭的工具,你不知道?</td>
</tr>
<tr>
<td><input type="checkbox" name="checks" onclick="checks()"></td>
<td>酒精</td>
<td>12</td>
<td>酒精你懂的</td>
</tr>
<tr>
<td><input type="checkbox" name="checks" onclick="checks()"></td>
<td>饭盒</td>
<td>15</td>
<td>吃饭的工具,你不知道?</td>
</tr>
<tr>
<td><input type="checkbox" name="checks" onclick="checks()"></td>
<td>酒精</td>
<td>12</td>
<td>酒精你懂的</td>
</tr>
<tr>
<td><input type="
Sql2008R2的一个补丁BUG-大家使用时请注意 - shanks_gao 阅读原文»
我们都知道Sqlserver为了提高并发,允许乐观隔离级别(读提交快照,快照)以便读与写之间不阻塞.这里有一个在Sqlserver2008R2 SP2 的热补丁(CU11)下RCSI(读提交快照)隔离级别下的异常.希望大家注意.
这里我通过实例给大家呈现.
Code 测试数据 (Sql2008R2 sp2 cu11)
create database testbug
select @@VERSION --Microsoft SQL Server 2008 R2 (SP2) - 10.50.4302.0 (Intel X86)
use testbug
go
create table testbug
(
id int identity(1,1) primary key,
str1 char(10)
)
insert into testbug select 'aa'
go 10000
ALTER DATABASE testbug
SET READ_COMMITTED_SNAPSHOT ON
with rollback immediate-------------修改库隔离级别为RCSI
select @@VERSION --Microsoft SQL Server 2008 R2 (SP2) - 10.50.4302.0 (Intel X86)
use testbug
go
create table testbug
(
id int identity(1,1) primary key,
str1 char(10)
)
insert into testbug select 'aa'
go 10000
ALTER DATABASE testbug
SET READ_COMMITTED_SNAPSHOT ON
with rollback immediate-------------修改库隔离级别为RCSI
开启session 1,显式事务update
begin tran ttt
update testbug set str1='cc'
update testbug set str1='cc'
开启session 2,select 将被阻塞.
select * from testbug ---将被阻塞
出乎意料,不是说好的乐观隔离级别下读与写不阻塞吗??
原因分析
我们从DMV sys.dm_tran_locks中查看具体阻塞情况如图1-1
select * from sys.dm_tran_locks
没有评论:
发表评论