table动态添加的tr 其click事件在IE兼容模式中不执行 jquery 1.9 的live事件 和获取 first last
http://www.css88.com/jqapi-1.9/first-of-type/index.html#p=//www.css88.com/jqapi-1.9/last-child-selector
---动态添加的table 的tr 给tr设定click事件 使用jquery 1.9
$(document).on("click", "#tableid tbody tr", function () {
$("#tableid tbody").find("tr").removeClass("trclass");
$(this).addClass("trclass");
var name = $(this).attr("data");
$("#txtsearch").val(name);
});
function changetable() {
var n = $.trim($("#txtsearch").val());
if (n != "") {
$.ajax({
type: "POST",
url: "../xxx/xx.aspx?action=getxx",
data: { "n": n },
dataType: "json",
async: false,
success: function (data) {
var varc = "";
$.each(data.Table, function (index, item) {
varc += "<tr data='" + item.id + "' ><td>" + item.id + "</td><td>" + item.name + "</td></tr>";
});
$("#tableid tbody").empty().append(varc);
}, error: function () {
}
});
}
}
--first(first-of-type) last(last-of-type)
$(document).on("click", "#file table tr td:first-of-type a", function () {
var n1 = $(this).attr("data"); var n2 = $(this).attr("data2");
down(n1, n2);
});
$(document).on("click", "#file table tr td:last-of-type a", function () {
var n = $(this).attr("data");
delAttach(this,n);
});
table动态添加的tr 其click事件在IE兼容模式中不执行 jquery 1.9 的live事件 和获取 first last的更多相关文章
- ASP.NET给Table动态添加删除行,并且得到控件的值
ASP.NET给Table动态添加控件并且得到控件的值 由于跟老师做一个小的项目,可是我自己又不太懂js,所以一直为动态建立表格并且能动态的取值和赋值感到苦恼.起初在网上找到了一些js资源,解决了动态 ...
- 利用jquery给指定的table动态添加一行、删除一行
转自:http://www.cnblogs.com/linjiqin/p/3148181.html $("#mytable tr").find("td:nth-child ...
- 利用jquery给指定的table动态添加一行、删除一行,复制,值不重复等操作
$("#mytable tr").find("td:nth-child(1)") 1表示获取每行的第一列$("#mytable tr").f ...
- 记一次LayUI中Table动态添加列数据
这次在开发中遇到,有列数不固定的情况.废话不多说,先上图,在上代码. 下面上JS代码 function SearchData() { var dYear = $("#DYear") ...
- jquery动态添加/删除 tr/td
<head runat="server"> <title></title> <!--easyui --> <link rel= ...
- table动态添加删除一行和改变标题
<style type="text/css"> body{ font-size:13px; line-height:25px; } table{ border-top: ...
- Js实现Table动态添加一行的小例子
<form id="form1" runat="server"> <div> <table id=" style=&qu ...
- 关于table动态添加数据 单元格合并 数组合并
var newArr = [ {"BranchID":1,"BranchName":"城二","BranchFullName&qu ...
- 用js 向h5 中的table 动态添加数据 (简单实现)
//向 表格传值 function setTextareaValue(items,pp){ console.log(" 进入函数 items=="+items); var tb = ...
随机推荐
- 点击 QTableView,触发事件
Here is an example of how you can get a table cell's text when clicking on it. Suppose a QTableView ...
- Excel导入异常Cannot get a text value from a numeric cell解决及poi导入时注意事项
POI操作Excel时偶尔会出现Cannot get a text value from a numeric cell的异常错误. 异常原因:Excel数据Cell有不同的类型,当我们试图从一个数字类 ...
- 安装并使用pyecharts库
在cmd命令行中输入安装命令, pyecharts库的安装命令如下: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyecharts ...
- Firefox 66 发布,阻止网站自动播放声音
Firefox 66 发布了,此版本在桌面版中带来的新特性包括: Firefox 现在阻止网站自动播放声音,如果需要可以单独调整 改进的搜索体验: 当打开许多选项卡时,可以更快地查找特定网页:现在可以 ...
- Flask中可以利用Flask-SQLAlchemy
为什么80%的码农都做不了架构师?>>> 官方文档:http://flask-sqlalchemy.pocoo.org/2.3/ 1.安装(进入虚拟环境)--利用镜像安装PyMy ...
- js特效:鼠标滑过图片时切换为动图
效果展示 事前准备 一张普通的静态图+与其对应的gif图. 实现思路 获取图片的src,改变其后缀,使其变成与之对应的gif图片.(很简单有木有= =) 具体实现 编写html代码 <div c ...
- The 2019 Asia Nanchang First Round Online Programming Contest B Fire-Fighting Hero(阅读理解)
This is an era of team success, but also an era of heroes. Throughout the ages, there have been nume ...
- Jenkins联动码云自动匹配分支进行构建流水线
一.安装Generic Webhook Trigger插件 二.创建项目 创建项目之前先准备自己的项目,如果没有可以我fork的一个项目.地址是:https://gitee.com/jokerbai/ ...
- Nginx入门资料
最近在学习Nginx,记录一下自己的学习历程. 1. Nginx开发从入门到精通 (淘宝技术团队编写,值得一看) 2. <深入理解Nginx:模块开发与架构解析> 3. Nginx模块开发 ...
- 单元测试中使用Spring的ReflectionTestUtils更方便
1 简介 ReflectionUtils是Spring中一个常用的类,属于spring-core包:ReflectionTestUtils则属于spring-test包.两者功能有重叠的地方,而Ref ...