> > $('myImage').setSrc('images/blah.jpg');
>
> <sarcasm>
> Wow, Kangax! That method really takes the pain out of writing
> $('myImage').src = 'images/blah.jpg';
> </sarcasm>
The point, as is seems to be with most methods in prototype, is to
allow for a continuous inline string of them.
As the suggestion was made by Gonzalo, you can use this function, and
others, to string all alterations into one relatively simple line:
$('myEmoticon').setSrc('images/sad.jpg').setAlt("I'm sad! :( ");
Or, follow Tobie's suggestion:
$('myEmoticon').writeAttribute({ src: 'images/smiling.jpg', alt: "I'm
smiling!" });
Either way, you eliminate the "pain" of setting each attribute per
line...plus, the "pain" of wasting resources getting the object
multiple times:
$('myEmoticon').src = 'images/sad.jpg';
$('myEmoticon').alt = "I'm sad! :( ";
But, congrats on making a public ass of yourself.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" 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/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---