Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery _Jquery_Html_Datatables_Jeditable - Fatal编程技术网

Jquery

Jquery ,jquery,html,datatables,jeditable,Jquery,Html,Datatables,Jeditable,Javascript抛出错误,返回“[used method]不是函数” 在这种情况下,解决方案是使用.textContent: //Example var tdContainer; for (int k = 0; k < $("td.myClass").length; k++){ tdContainer += $("td.myClass")[k].textContext + ", "; } //示例 集装箱; 对于(int k=0;k

Javascript抛出错误,返回“[used method]不是函数”

在这种情况下,解决方案是使用
.textContent

//Example
var tdContainer;
for (int k = 0; k < $("td.myClass").length; k++){
     tdContainer += $("td.myClass")[k].textContext + ", ";
}
//示例
集装箱;
对于(int k=0;k<$(“td.myClass”).length;k++){
tdContainer+=$(“td.myClass”)[k].textContext+“,”;
}

希望这对你们中的一些人有所帮助。

TD元素不会触发更改事件。您可以使用click。@未定义:更新了问题。您可以使用click方法。TD元素不会触发更改事件。您可以使用click。@未定义:更新了问题。您可以使用click方法。我们真的需要美元吗?可以用$('.qty')完成吗?@diEcho:因为有多个
具有相同的
属性,它将打印除更改的
之外的另一个
值。我们真的需要$('#示例tbody tr td.qty')?可以用$('.qty')完成吗?@diEcho:因为有多个
具有相同的
属性,它将打印除更改的
之外的其他
值。
console.log($('#example td.qty').text());
console.log($.text(sQty));
console.log(sQty.text());
$('#example tbody tr td.qty').click(function () {
    var sQty = $(this);

    console.log(sQty.html()); // print [<td class="right editable qty">100</td>]
    console.log(sQty.text()); // print 100
    console.log(sQty.val()); // nothing will print,val() is for input type elements
}); 
/* Apply the jEditable handlers to the table */
oTable.$('td.editable').editable(
    function(value, settings) {
        if($(this).hasClass('qty')) // The editable class not only on one column.
            console.log(value);
        return(value);
    },
    {   
        "height": "100%",
        "width": "100%"
    }
);
<td class="rigth editable qty">
    <form>
        <input style="width: 100%; height: 100%; " autocomplete="off" name="value">
    </form>
</td>
<td class='myClass'>1</td>
<td class='myClass'>2</td>
<td class='myClass'>3</td>
//Example
var tdContainer;
for (int k = 0; k < $("td.myClass").length; k++){
     var tdContainer = $("td.myClass")[k].text() + ", "; //Throws "Uncaught TypeError"
}
//Example
var tdContainer;
for (int k = 0; k < $("td.myClass").length; k++){
     tdContainer += $("td.myClass")[k].textContext + ", ";
}