jQuery Select change event firing twice

Hmmm...nice one

< select id="my_dd" > < ! -- options -- >< /select >

jQuery code:

$('#my_dd').change(function(){
     alert('hello') ;
})


Surprisingly on change the alert was getting fired twice.

Solution:

Nothing much, this was more or less my ignorance, put the block inside document ready and everything should be fine

Final code:

$(document).ready(function(){
     $('#my_dd').change(function(){
         alert('hello') ;

     })
})



Hope this helps anyone.

Cheers

Comments

Popular posts from this blog

uTorrent: Data error (cyclic redundancy check)

Khude Jajabor Istasi

Photo upload to Facebook from your PHP web application