單擊下拉按鈕時,我需要觸發ajax加載。 我不知道爲什麼它不工作,也許是引導具有一定prevent.default在其下拉驅動引導程序下拉列表以調用ajax加載
<a id="country" data-toggle="dropdown" class="dropdown-toggle" href="#">
<i class="fa fa-comments-o"></i>
<span class="badge bg-success2">{{ ScadNumNav }}</span>
</a>
JS
$(document).ready(function() {
$('#country').click(function() {
if (!$(this).hasClass('open')) {
$.get("{% url 'azzera_notifiche' %}");
doSomething();
setInterval(doSomething, 5000);
}
});
});
的感謝!
完美,謝謝! –