ich den folgenden JavaScript-Code haben:Javascript Stecker in Noty gibt Fehler
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();
}
}
]});
}
Als ich aus dem Konsul laufen delete_draft(6, "this is it")
ich diesen Fehler
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, dass es funktionieren sollte, kommentieren.
Was ist 'noty'? im Code 'var noty = noty' noty als Funktion ist undefiniert. Vielleicht brauchen Sie 'var noty = function ('? – Vsevolod
@Vsevolod Deshalb habe ich einen Link auf die Noty-Site im unteren –
@ "Mike G" Ich kann Ihren Link nicht öffnen :-(Wie Sie die Notiz einstecken. js in dir html? – Vsevolod