Prototype JS - Determine if an object exists in the page loaded

I'm so use to using jQuery that I usually don't have to look up documentation on how to use certain functions. They almost come naturally because it's so English-like! Unfortunately Magento uses Prototype as it's native choice of Javascript Frameworks. I sure wish they would have chosen jQuery! I think they would have more people jumping on their platform. I'm sure they have a good choice for it. Anyway, here's how to check:

if($('id_of_element') != undefined) {
    alert('Object exists.');
}

0 comments for Prototype JS - Determine if an object exists in the page loaded

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.