Understanding colon purpose in hw.js

10 views
Skip to first unread message

Dave

unread,
Dec 18, 2011, 1:47:08 PM12/18/11
to hppg - high performance photo gallery
I'm trying to learn more about javascript and jquery in hppg but am
stuck on something simple. Where does the colon in the line of code
below originate from?

vote : function (photo,score)

How come it's not "function vote(photo,score)" or something similar?
I've had a good search for other examples of jquery/javascript using
similar expressions but can't find anything. Any pointers really
appreciated.

Remigijus Kiminas

unread,
Dec 18, 2011, 1:50:50 PM12/18/11
to hppg - high performance photo gallery
It's function of variable hw. That's why sintax is like this. Variable
is defined here:
http://code.google.com/p/hppg/source/browse/trunk/design/defaulttheme/js/hw.js#6

So that why I define function for hw variable. And it becomes
hw.vote() and is available during page lifetime.

Dave

unread,
Dec 18, 2011, 3:08:57 PM12/18/11
to hppg - high performance photo gallery
I see, that helps my understanding, thanks.

On Dec 18, 6:50 pm, Remigijus Kiminas <rem...@gmail.com> wrote:
> It's function of variable hw. That's why sintax is like this. Variable

> is defined here:http://code.google.com/p/hppg/source/browse/trunk/design/defaulttheme...

Reply all
Reply to author
Forward
0 new messages