In my experience the best way to do this is to use an index.
var hasbeeninserted=[];
....
hasbeeninserted['uniquie_identifier'] = true;
...
if( !hasbeeninserted['uniquie_identifier'] ){
///has not been inserted yet
}else{
///already inserted
}
On Tue, Aug 30, 2011 at 7:27 PM, Enkidu <[email protected]> wrote:
> Hi,
>
> to access a form that is dynamically inserted in a page, I use this
> code:
>
> document.body.addEventListener( 'DOMNodeInserted',
> function( event ) { GroupQuoteMailContainer(event.target); },
> false );
>
> function GroupQuoteMailContainer( container ) {
> var msgform = $('#message-form');
> if( msgform ) GroupQuoteMail( msgform );
> }
>
> function GroupQuoteMail( node ) {
> alert( 1 );
> }
>
> But in some circumstances (maybe because the site itself touches the
> form, I do not know), my function GroupQuoteMail() is called more than
> once with exactly the same node.
>
> Is there an easy way to prevent such duplicate calls? Or to detect and
> skip dupes it in an easy way?
>
> Tnx in advance.
>
>
> Regards,
> Robert
>
> --
> You received this message because you are subscribed to the Google Groups
> "greasemonkey-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/greasemonkey-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en.