Firefox使用我的用戶名/密碼填充表單。這是使用knockout.js綁定輸入,但它不會更新這種填充的值。我在頁面加載時錯過了什麼嗎?當它填充並且用戶點擊提交時,值爲空。knockout.js和Firefox在登錄表單上保存密碼
(function (app, $, undefined) {
app.viewModel = app.viewModel || {};
app.login = {};
app.viewModel.login = {
userName: ko.observable(''),
password: ko.observable(''),
returnUrl: ''
};
app.viewModel.login.submit = function() {
sso.login(app.viewModel.login.userName(), app.viewModel.login.password(), app.viewModel.login.returnUrl);
};
app.login.init = function (returnUrl) {
app.viewModel.login.returnUrl = returnUrl;
ko.applyBindings(app.viewModel);
};
})(window.app = window.app || {}, jQuery);
Knouckout.js需要處理'input'事件。 – SLaks