给GridView加两个javascript特效
在数据绑定事件中写如下代码:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row .RowType == DataControlRowType .DataRow)//判断是否为数据行
{
//在点击删除时,弹出提示对话框
LinkButton lb = e.Row.FindControl("LinkButton1") as LinkButton;
lb.Attributes.Add("onclick","return confirm('确认?')");//是否触发onclick事件
//给数据行加载样式(用javascript)(光棒效果)
e.Row.Attributes.Add("onmouseover", "aa=this.style.backgroundColor;this.style.backgroundColor='#6699ff'");
e.Row.Attributes.Add("onmouseout","this.style.backgroundColor=aa");
}
}
相关文档:
1.HTML文档树形表示
2.Node[] Node.childNodes
//返回Node对象的所有字节点
3.Node.firstChild / lastChild /nextSibling(下一个兄弟节点) / previousSibling (上一个兄弟节点) / parentNode
属性
4.Node.appendChild() / removeChild() / replaceChil ......
javascript中setTimeout()函数
大家都知道javascript中的setTimeput()函数的作用,一般会用他来处理一些连续的事情,们先看一个例子:
<head>
<script>
function init()
  ......
JavaScript不区分单个字符和字符串,任何字符或字符串可以用双引号或单引号引起来。如果字符串本身含有双引号,则应使用单引号将字符串括起来;如果字符串本身含有单引号,则应使用双引号将字符串引起来,两者可以嵌套使用。 ......
一、主页面(采用jsp实现)
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312"%>
<%@page import="org.accp.jwebplayer.biz.MusicBiz"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<h ......
常用:javascript字符串函数 收藏
concat
将两个或多个字符的文本组合起来,返回一个新的字符串。
var a = "hello";
var b = ",world";
var c = a.concat(b);
alert(c);
//c = "hello,world"
indexOf
返回字符串中一个子串第一处出现的索引(从左到右搜索)。如果没有匹配项,返回 -1 。
var index1 = a.indexOf ......