我有下面的代码,该原则是在< TD当点击>它给出了两个警报框:从jQuery的。点击功能奇怪的错误消息话题
1)与数据值(例如1)
2)与文本(11001)
但是当我点击它,我得到的“类型”变量follwoing错误:
function (value) {
return jQuery.access(this, function(value) {
return value === undefined ?
jQuery.text(this) :
this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(value));
}, null, value, arguments.length);
}
我假设它是一些非常明显的,但我看不到什么?
<html>
<head>
<script language="JavaScript" src="../Generic/JAVASCRIPT/jquery.js" type="text/javascript"></script>
<script>
$(document).ready(function()
{
$('.updatefield').click(function()
{
var typeid = $(this).closest('tr').children('td.rowType1').data('value');
var type = $(this).closest('tr').children('td.rowType1').text;
console.log(typeid);
console.log(type);
}
)
})
</script>
</head>
<body>
<Table>
<tr>
<td class="updatefield rowType1" data-value="1">11001</td>
</tr>
</Table>
</body>
</html>
看,我知道这是明显的事情,欢呼...... – IGGt