js求助
function textpress() {var context = "";
var text = document.getElementById("shurukuang").value;
//获取要查询的字段,要显示的字段,要查询的表,连接字符串,返回的条数
var showName = '<%= getshowName() %>';
var queryName = '<%= getqueryName() %>';
var shwoTable = '<%= getshwoTable() %>';
var connStr = '<%= getconnStr() %>';
var count = '<%= getcount() %>';
//调用web服务返回字符数组
Service.DoWork(text,count,showName,queryName,shwoTable,connStr,OnComplete, OnFailed, context);
return true;
}
function OnComplete(args, context) {
var table = document.getElementById("tb1");
var pchildren = table.childNodes;
//清空表中的行和列
for (var a = 0; a < pchildren.length; a++) {
opanel.removeChild(pchildren[a]);
}
if(args!=""){
var span = $get("span");
var tab = document.getElementById("tb1");
//创建行,列
var tr = tab.insertRow(0);
var td1 = tr.insertCell();
td1.innerHTML = "药品编码";
var td1 = tr.insertCell(1);
td1.innerHTML = "药品拼音码";
var td1 = tr.insertCell(2);
td1.innerHTML ="药品学名";
for (var i = 0; i < args.length; i++) {
var tab = document.getElementById("tb1");
var tr = tab.insertRow(1);
var arr = new Array();
arr = args[i].split(" ");
var td1 = tr.insertCell();
td1.innerHTML = arr[0];
var td1 = tr.insertCell(1);
td1.innerHTML = arr[1];
var td1 = tr.insertCell(2);
td1.innerHTML = arr[2];
}
}
}
function OnFailed(args) {
alert("提取数据失败!");
}
请问鼠标点击一行怎么获取他的值 , 代码写在哪里??? --------------------编程问答-------------------- 给tr加click事件,把tr的值传到方法里就行了
比如
function selectedTableRow(sender,data1,data2,data3,data4)
{
...
}
tr.onclick = selectedTableRow(this,data1,data2,data3,data4); --------------------编程问答--------------------
+1
补充:.NET技术 , ASP.NET