良い一日
Web ページでノックアウトを使用しています。これで、ユーザーがエントリを削除してノックアウト ポップアップが表示され、エントリ/カードを削除する確認をユーザーに求めることができる、カードの削除/一時停止機能が追加されました。
問題は IE8 にあります。[削除] をクリックすると、ポップアップが表示されますが、位置がずれ、IE でデバッグ エラーが発生します。エラーの詳細は次のとおりです。
self.options.theme.style.apply(self); (line in code with the issue)
SCRIPT1010: Expected identifier
default.js, line 3 character 16
LOG: test4
LOG: 68
SCRIPT5007: Unable to get value of the property 'style': object is null or undefined
jquery.noty.js, line 88 character 4
SCRIPT5007: Unable to get value of the property 'style': object is null or undefined
jquery.noty.js, line 88 character 4
どうすればこれを修正できますか?
私のウェブページのノックアウトコードは次のとおりです。
<script type="text/javascript">
var w = $('#cardsAdded table').innerWidth();
$('#totalCost').css('width', w);
function DisplayConfirmNoty(message, buttons) {
var n = noty({
text: message,
type: 'confirm',
dismissQueue: true,
layout: 'center',
theme: 'default',
buttons: buttons
});
}
var vm = {
Data: ko.observable(),
BankAccount: ko.observable(),
//bankactive: ko.observable(false),
Suspend: function (card) {
console.log(card.CardId());
var d = {
cardId: card.CardId()
}
DisplayConfirmNoty("Please note this action is irreversible trough Card Vault and you will have to contact card vendors personally to reactivate suspended cards", [
{
addClass: 'btn btn-primary', text: 'Cancel', onClick: function ($noty) {
$noty.close();
}
},
{
addClass: 'btn btn-danger', text: 'Suspend', onClick: function ($noty) {
var options =
{
url: "SuspendCards.aspx/SuspendCard",
type: "POST",
contentType: "application/json",
data: JSON.stringify(d),
success: function (response) {
window.location = "ConfirmedSuspension.aspx";
}
}
$.ajax(options);
$noty.close();
}
}
]);
},
SuspendAll: function () {
DisplayConfirmNoty("Please note this action is irreversible trough Card Vault and you will have to contact card vendors personally to reactivate suspended cards", [
{
addClass: 'btn btn-primary', text: 'Cancel', onClick: function ($noty) {
$noty.close();
}
},
{
addClass: 'btn btn-danger', text: 'Suspend All', onClick: function ($noty) {
var options =
{
url: "MyAccount.aspx/SuspendAllCards",
type: "POST",
contentType: "application/json",
success: function (response) {
window.location = "ConfirmedSuspension.aspx";
}
}
$.ajax(options);
$noty.close();
}
},
]);
},
Remove: function (card) {
console.log(card.CardId());
var d = {
cardId: card.CardId()
}
DisplayConfirmNoty("Are you sure you want to remove this card?", [
{
addClass: 'btn btn-primary', text: 'Cancel', onClick: function ($noty) {
$noty.close();
}
},
{
addClass: 'btn btn-danger', text: 'Remove', onClick: function ($noty) {
var options =
{
url: "MyAccount.aspx/DeleteCard",
type: "POST",
contentType: "application/json",
data: JSON.stringify(d),
success: function (response) {
window.location = window.location;
}
}
$.ajax(options);
$noty.close();
}
}
]);
}
}
var cardsBound = false;
var accountBound = false;
$(document).ready(function () {
LoadAccount();
LoadCards();
// $("#")
});
function LoadCards() {
var options =
{
url: "MyAccount.aspx/GetCardTypes",
type: "POST",
contentType: "application/json",
success: function (response) {
vm.Data(ko.utils.unwrapObservable(ko.mapping.fromJS(response.d)));
if (!cardsBound)
ko.applyBindings(vm, document.getElementById("cardsAdded"));
cardsBound = true;
}
}
$.ajax(options);
}
function LoadAccount() {
var options =
{
url: "MyAccount.aspx/GetAccount",
type: "POST",
contentType: "application/json",
success: function (response) {
vm.BankAccount(ko.utils.unwrapObservable(ko.mapping.fromJS(response.d)));
if (!accountBound)
ko.applyBindings(vm, document.getElementById("vmBankAccount"));
accountBound = true;
console.log(vm.BankAccount()[0].AccountName());
//if (vm.BankAccount.length > 0)
// vm.bankactive(true);
}
}
$.ajax(options);
}
</script>
ありがとうございました