Hi Guys,
Struggling a little here with prototype = I've created this function
Event.observe(window, 'load', function() {
if ($$('#test li:first')!=null) {
$('test').down('li').down('a').update('Test');
}
});
Basically, it works on pages where #test li:first is found but on pages it isn't it returns
$("test").down("li") is undefined
I just wanted it to basically work only if it found the element otherwise not work ?
Edit: Solved
Event.observe(window, 'load', function() {
try {
if ($$('#test li:first')!=null) {
$('test').down('li').down('a').update('Test');
} }
catch(ex) {
}
});