0
當引導咆哮放置在編號1或編號2時,它工作正常。jQuery插件不可用於ajax
當它被放置在3號......我得到的錯誤:
Uncaught TypeError: $.bootstrapGrowl is not a function
<script>
// 1
$.bootstrapGrowl('Foo')
function addDeleteAnswerListener(button, div, id) {
// 2
$.bootstrapGrowl('Foo')
$('#' + button).click(function() {
$.ajax({
type: 'DELETE',
dataType: 'json',
url: window.location.origin + '/api/Answers/' + id + '?access_token=' + Cookies.get("authorization"),
success: function (res) {
$('#' + div).hide()
answerCount();
// 3
$.bootstrapGrowl('Foo')
},
error: function (res) {
window.alert(res.responseJSON.error.message)
}
})
})
}
</script>
如何調用bootstrap-growl插件從Ajax調用內?
感謝您的回答!試過...相同的結果。 'TypeError:$ .bootstrapGrowl不是函數' – user465342
@ user465342 ..你有沒有試過用jQuery而不是$?也許在某處有衝突 –
嘿......你是什麼意思?請舉一個例子。 – user465342