javascript - Calling a function when dropdown toggle is clicked -
i have dropdown-toggle , want call function read();
every time clicked or toggled. there wrong onclick
command wherein calling function read();
though toggle not clicked. have tried other commands such ondrop
html:
<a data-toggle="dropdown" class="dropdown-toggle" onclick="read();"> <i class="fa fa-globe"></i> <span class="badge"> <%=unread%> </span> </a>
javascript:
function read() { <% notificationdao.read(((user)session.getattribute("user")).getemployeeid()); %> }
guessing using bootstrap data-toggle has own events
$('#mydropdown').on('show.bs.dropdown', function () { call read method here.. })
hope helps.
Comments
Post a Comment