Tengo el siguiente código javascript:enchufe Javascript en Noty da error
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();
}
}
]});
}
Cuando corro del cónsul delete_draft(6, "this is it")
me sale este error
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
¿Cómo puedo solucionar este problema? El sitio web de Noty es http://needim.github.com/noty/ Si crees que debería funcionar, comenta.
¿Qué es 'noty'? en el código 'var noty = noty' noty ya que la función no está definida. Puede ser que necesites 'var noty = function ('? – Vsevolod
@Vsevolod Es por eso que puse un enlace al sitio noty en el bottum –
@ "Mike G" No puedo abrir tu enlace :-(Cómo enchufas la nota. js en tu html? – Vsevolod