0

再会

我在我的网页上使用淘汰赛。现在我有一个删除/暂停卡片功能,用户可以删除一个条目,然后弹出一个敲除弹出窗口并要求用户确认删除他的条目/卡片。

问题在于 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>

谢谢

4

1 回答 1

0

尝试这个:

options.theme.style

以下是一些可以帮助您的网址:

  1. https://github.com/needim/noty/pull/
  2. https://github.com/needim/noty/pull/61
于 2013-03-07T10:31:33.060 回答