Ticket #3616 (closed bug: invalid)
Double event execution
| Reported by: | webJ@… | Owned by: | brandon |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3 |
| Component: | event | Version: | 1.2.6 |
| Keywords: | Cc: | webJ@… | |
| Blocking: | Blocked by: |
Description
I have found that sometimes an event is executed twice. $('#submit').click(function() { ... this executed twice ... } Dont know why.
Attachments
Change History
Changed 5 years ago by webJ@…
-
attachment
jquery_and_zend_framework.txt
added
JQery Events with PHP (Zend Framework variables)
comment:2 Changed 5 years ago by webJ@…
I attached file with code where I have problems.
Mainly its all about:
$('#submit_nowe_zam<?=$this->escape($klienci->id)?>').click(function() { $('#zapis<?=$this->escape($klienci->id)?>').click(function() {
I get ajax success and java script alerts twice, unfortunately.
comment:3 Changed 5 years ago by bundy
I have the exact same issue with a plugin a wrote for my webapp..
comment:4 Changed 5 years ago by webJ@…
I have tested it with: dbclick, mouseup, mousedown and it accures everytime. Also thought it was a browser bug but its the same on IE6, IE7 and Firefox 3.
When setting asynchronous transmission on ajax, it waits a second and gives an unwanted, second execution (doubled).
Does anyone found a solution (patch) to that?
comment:5 Changed 5 years ago by webJ@…
Discovery!
When event handler is outside $(document).ready(function() {... everthing seems to be ok.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Can you provide a test case ? a minimalistic html file with the requires html and js to reproduce the problem