On 14/12/06, floepi <[EMAIL PROTECTED]> wrote:
>
> 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

Have you tried 'unclick'?

$('#mainWindow').unclick().click(...

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

Reply via email to