Hi Sam,

hmm but that would remove all click events, right? What if i have another
plugin which attaches something to the click event of my mainWindow?

It would be great, if the event handler would check if that function is
already attached to the element before attaching the same function again.
Has someone raised this issue before and i just missed the discussion about
it ?

Cheers

Phil 


Sam Collett wrote:
> 
> 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/
> 
> 

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


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

Reply via email to