Understanding the Colon (":") in jQuery Code

  • Thread starter Thread starter jeff1evesque
  • Start date Start date
  • Tags Tags
    Code
AI Thread Summary
In JavaScript, the colon ":" in the provided code segments signifies the association between a property and its value within an object. In the first example, "SplitID" is a property that points to a function, which retrieves the last segment of an ID attribute split by a hyphen. In the second example, "Slideshow" is an object containing a property "Ready," which is also a function. This structure illustrates how JavaScript uses key-value pairs to define properties and methods within objects, functioning similarly to a hash table.
jeff1evesque
Messages
312
Reaction score
0
I've looked all over the web, and even downloaded a http://www.pdf-search-engine.com/jquery-pdf.html" (looks very useful), but I have a very simple question.

What does the colon ":" mean from the following three segment of code-

(1.)
SplitID : function()
{
return this.attr('id').split('-').pop();
},

(2)
Slideshow :
{
Ready : function()
{
}
}

Thanks,

JL
 
Last edited by a moderator:
Technology news on Phys.org
jeff1evesque said:
I've looked all over the web, and even downloaded a http://www.pdf-search-engine.com/jquery-pdf.html" (looks very useful), but I have a very simple question.

What does the colon ":" mean from the following three segment of code-

SplitID :function()
{
return this.attr('id').split('-').pop();
},

And,

Slideshow :
{
Ready : function()
{
}
}

Thanks,

JL

Property: Value

All javascript code is essentially one giant hash table.
 
Last edited by a moderator:
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Back
Top