Javascript-plug-in-Noty Fehler gibt

Habe ich den folgenden javascript-code:

function delete_draft(id, name) {
    var text = 'Are you sure you want to delete "' + name + '"?';
    alert(id + name)
    var noty = noty({
        text: text,
        buttons: [
        {addClass: 'btn btn-primary', text: 'Yes', onClick: function($noty) {

            //this = button element
            //$noty = $noty element

            $noty.close();
            $.post('/ajax/drafts/delete', {id:id}, function(data) {
                document.location.reload(true);
            });
        }
        },
        {addClass: 'btn btn-danger', text: 'Cancel', onClick: function($noty) {
            $noty.close();
        }
        }
    ]});
}

Wenn ich der Konsul delete_draft(6, "this is it") ich bekomme diese Fehlermeldung

TypeError: undefined is not a function
arguments: Array[1]
get message: function () { [native code] }
get stack: function () { [native code] }
set message: function () { [native code] }
set stack: function () { [native code] }
type: "called_non_callable"
__proto__: Error

Wie kann ich dieses Problem beheben? Die website für Noty ist http://needim.github.com/noty/
Wenn Sie denken, es sollte funktionieren, Kommentar.

  • Was ist noty ? im code var noty = noty noty als Funktion nicht definiert ist. Möglicherweise müssen Sie var noty = function( ?
  • Das ist, warum ich einen link zu der noty-site der bottum
  • G" ich kann deinen link nicht öffnen : - (, Wie du den Stecker note.js in Ihr html?
InformationsquelleAutor sinθ | 2012-08-11
Schreibe einen Kommentar