http://net.tutsplus.com/tutorials/javascript-ajax/into-the-ring-with-knockout-js/KnockJS和JQuery教程assitance需要
我努力回合2 - 創建視圖,使用公佈在網站上的代碼,我被FF FB返回一個錯誤1.7.3
Error: missing) in parenthetical Source File: http://testing:8888/knockout/js/behavior.js Line: 7, Column: 3 Source Code: }; ko.applyBindings(viewModel);
行爲
(function ($) { var model = [{ name: "John", address: "1, a road, a town, a county, a postcode", tel: "1234567890", site: "www.aurl.com", pic: "/i/john.jpg", deleteMe: function() { viewModel.people.remove(this); }
}, { name: "Jane", address: "2, a street, a city, a county, a postcode", tel: "1234567890", site: "www.aurl.com", pic: "/i/jane.jpg", deleteMe: function() { viewModel.people.remove(this); }
}, { name: "Fred", address: "3, an avenue, a village, a county, a postcode", tel: "1234567890", site: "www.aurl.com", pic: "/i/fred.jpg", deleteMe: function() { viewModel.people.remove(this); }
}, { name: "Freda", address: "4, a street, a suburb, a county, a postcode", tel: "1234567890", site: "www.aurl.com", pic: "/i/jane.jpg", deleteMe: function() { viewModel.people.remove(this); }
}], viewModel = { people: ko.observableArray(model),
} }; ko.applyBindings(viewModel); })(jQuery);
謝謝,你可以藉助你的智慧調試,因爲什麼都沒有返回到錯誤控制檯或提醒? – Wasabi
這仍然不適合你?你有所有合適的js文件嗎? – kakridge
它在工作,但想知道你是否藉助你的調試洞察力,或者這是你已經熟練使用的東西。 – Wasabi