wrap all your processing with some like that:

function genericProcess(elemIdToLookup, functionToApply) {

    elem = getElement(elemIdToLookup);
if (elem) {
    functionToApply(elem);
}

}

This way, if the 'id' doesn't exists, your function is not invoked...

Hope this helps.


Jorge Godoy escribió:
> Hi!
>
>
> I'd like to have some generic processing directive that would be applied on
> each and every page where there was an object with id 'X'.  If I try
> manipulating it directly, I get a JavaScript error and I have the feeling that
> all future operations are ignored (i.e., my JS code simply aborts where the
> error ocurred), so I'd like to find out if the object exists and then
> manipulate the object... 
>
> Was I too confuse? :-)
>
>   

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"MochiKit" 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/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to