js闭包的使用
学习了:https://www.cnblogs.com/ZinCode/p/5551907.html
终于用上了闭包,还是有些生涩;好像柿子还没熟;
function createList(list, divObject) { for (var i = 0; i < list.length; i++) { var monitor = list[i]; var id = divObject.attr("id") + monitor["id"]; var html = '<div class="ss" id="' + id + '"> ' + ' <p>' + monitor.title + '</p> ' + ' </div>'; divObject.append(html); $('#' + id).click(function (obj) { return function () { divListAppPersonClick(obj); } }(monitor)); } }