A javascript problem when learning Beast

now i’m learning the Beast source code,
but a problem happened when read the javascript like below:

var TopicForm = {
editNewTitle: function(txtField) {
$(‘new_topic’).innerHTML = (txtField.value.length > 5) ?
txtField.value : ‘New Topic’;
}
}

what’s the meanning of
" var xxx = {

} " ?

i haven’t known such using…

appricated if you can give me some adivce or any useful link :slight_smile:

thanks!

On 5/17/07, Yan R. [email protected] wrote:

}

thanks!

var xxx = … is what we in the porn industry use to declare
javascript variables. The brackets ( {}'s ) is used for declaring an
object literal.

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Literals#Object_Literals

Also, you’ll probably get more intelligent responses in the
rails-spinoff thread, which is dedicated to prototype/scriptaculous.


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com

thanks!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs