मैं निम्नलिखित जावास्क्रिप्ट कोड है देता है:जावास्क्रिप्ट प्लग त्रुटि
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();
}
}
]});
}
जब मैं वाणिज्य दूत delete_draft(6, "this is it")
से चला मैं यह त्रुटि
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
मैं इसे कैसे ठीक कर सकते हैं? नोटी के लिए वेबसाइट http://needim.github.com/noty/ यदि आपको लगता है कि इसे काम करना चाहिए, तो टिप्पणी करें।
'नोटी 'क्या है? कोड में 'var noty = noty' नोटी के रूप में कार्य अनिर्धारित है। हो सकता है कि आपको 'var noty = function ('? – Vsevolod
@Vsevolod की आवश्यकता हो, इसलिए मैंने बोटम –
@" माइक जी "पर नोटी साइट पर एक लिंक डाला है, मैं आपका लिंक नहीं खोल सकता :-(आप नोट कैसे प्लग करते हैं। आप में एचटीएमएल? – Vsevolod