Reputation: 16512
I wanted some nice buttons so I use .button()
in jQuery like this:
$(document).ready(function() {
$("#idBlaBla").button();
});
server side:
Private Sub btnSaveVisible_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSaveVisible.ServerClick
The problem is that when I click it fires the even twice. It doesn't happen in debug with visual studio 2008. but when the website is online, every buttons with jQuery trigger the event twice.
Any ideas?
Thank you
Upvotes: 0
Views: 1082
Reputation: 1672
In that case, we can do the following
$('selected').unbind('click').bind('click', function (e) {
add_course(this);
});
I had the event firing two times initially, when the page get refreshed it fires four times. It was after many fruitless hours before I figured out with a google search.
I must also say that the code initially was working until I started using the JQueryUI accordion widget.
Upvotes: 1
Reputation: 6036
try this:
//call event click or press button
$('#idBlaBla').click();
//listen event
$('#idBlaBla').click(function( event ){
//your code here...
});
//listen multi events
$('#idBlaBla').bind('click focus blur',function( event ){
//your code here...
});
//listen new element(append fro example)
$('.div').append( '<a href="" id="idBlaBla">Anchor Button</a>' );
$('#idBlaBla').live('click',function( event ){
//your code here...
});
Upvotes: 1