js方法第一遍就运行完了,model框没关闭,点第二次才关闭,这是什么原因呀

第一遍打印了但关闭没成功,按第二次就成功了

$(".bmsave").live("click",function(){
//一些赋值的代码省略

            alert("123456");
            $("#bmModal").modal('hide');            
        });

你第一次可能没点中~

这几行真看不出啥来 多帖点呗

$("#bmModal").modal('hide');
和 $("#bmModal").hide(); 有什么区别

$(".bmsave").live("click",function(){
var clicked=$(".clicked");
var tableTr=$("#wzBody tr");
var index= clicked[0].rowIndex;//当前位置
var Depth;//艮节点位置
var Bepth;//大类节点位置
var nowDepth=clicked[0].attributes.depth.value-2;//当前节点
var i=1;
/* var root=tableTr[index-i].firstChild.innerText;//根 */
while(Depth!="1"){
i++;
Depth=tableTr[index-i].attributes.depth.value;
$("#purpose").val(tableTr[index-i].firstChild.innerText);//用途
}i=0;
$("#big_class").val("");//大类
while(parseInt(Bepth)!=nowDepth && nowDepth!=0){
i++;
Bepth=tableTr[index-i].attributes.depth.value;
$("#big_class").val(tableTr[index-i].firstChild.innerText);//大类
}
$("#p-name").val(clicked[0].firstChild.innerText);//个
$("#goods-name").val(clicked.prev()[0].firstChild.innerText);
$("#small_class").val(clicked.prev()[0].firstChild.innerText);//其他
$("#showMaterial").val($("#materialCode").val());
alert("123456");
$("#bmModal").modal('hide');

});

加上死循环等待文本框设置了,再往下执行