Forum: Rails deployment A javascript problem when learning Beast

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
158fd6a8f789a94711891e8338592f6e?d=identicon&s=25 Yan Rong (yananay)
on 2007-05-17 08:54
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 :)

821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 Rick Olson (Guest)
on 2007-05-17 15:55
(Received via mailing list)
On 5/17/07, Yan Rong <> 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.

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

Rick Olson
158fd6a8f789a94711891e8338592f6e?d=identicon&s=25 Yan Rong (yananay)
on 2007-05-18 03:54
This topic is locked and can not be replied to.