KnockoutJS catch errors Binding

前端 未结 2 1774
孤独总比滥情好
孤独总比滥情好 2020-12-23 23:52

I want to catch an error, correct it and continue executing the program. http://jsfiddle.net/Gthv9/12/

But, I can\'t do it!

If you click on: \"re Check On Mo

2条回答
  •  盖世英雄少女心
    2020-12-24 00:18

    I added another line to the error handler from @RPNiemeyer to console the node causing the error in the catch block - makes it really easy to find an error on a complex page:

    if (console && console.log) {
                console.log("Error in binding: " + e.message);
                console.log("Node causing error:");
                console.log(node);
            }
    

提交回复
热议问题