javascript - 在javascript中使用if条件
问题描述
我想if
在javascript中使用。我使用了if
下面提到的条件。但是是不正确的。为什么错了。我该如何解决?
var fixHelperModified = function(e, tr) {
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function(index) {
$(this).width($originals.eq(index).width())
});
return $helper;
},
if (window.confirm("Do you really want to update the order?")) {
updateIndex = function(e, ui) {
$('td.index', ui.item.parent()).each(function(i) {
$(this).html(i + 1);
});
};
}
$("#table tbody").sortable({
helper: fixHelperModified,
stop: updateIndex
}).disableSelection();
解决方案
您必须删除第','
8 行中的内容。
推荐阅读
- python - 散景-指布局内一行中的子级
- r - 在 R 中使用 for 和 If 循环来转换数据
- c++ - 以长长的数字打印位(C++)
- python - 如何使用操作员进行 logging.debug?
- ios - iOS CoreBLE 每隔一次发现就成功连接到发现的设备
- r - 在使用 lmerTest 创建的线性混合模型上使用 broom::tidy 时出错
- android - Android LiveData 转换
- ubuntu - 如何在 X11 (Ubuntu) 中设置图标名称
- android-studio - 构建第一个默认应用程序时构建错误“任务':app:preDebugAndroidTestBuild'执行失败”
- asp.net - 在 asp.net 和 Oracle SQL 中处理 Null 值