Hi,

i have the following problem using the events in jQuery:

$('#mainWindow').click(function(){
 alert('test');
});

and load this function at the end of a php script:
<?php
bla bla bla
?>
<script>
my function
</script>

The problem is that i load this data into the mainWindow which means, that
the event gets attached each time i load content into the mainWindow. So
when i click in the mainWindow i get multiple alert messages. 

Is there a way to tell jQuery to overwrite the event if the function is the
same. Otherwise i have to use the specific unbind each time i load data into
the window, which feels hacky and unnecessary.

Thanks for your time. Maybe you know how to solve my problem. 

Cheers

Phil
-- 
View this message in context: 
http://www.nabble.com/Duplicate-Events-tf2820382.html#a7871863
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to