what's the meaning of this

var theme =  $.data(document.body, 'theme');

Thanks in advance
gamjaradioAsked:
Who is Participating?
 
Php_expertConnect With a Mentor Commented:
Refer this link for more information about data storage using jQuery:

http://www.ibm.com/developerworks/web/library/wa-domjquery/index.html
0
 
Kiran SonawaneConnect With a Mentor Project LeadCommented:
Go through this link you will get an idea about .data()

http://api.jquery.com/data/
0
 
HugoHiaslConnect With a Mentor Commented:
It reads an attached stored data-value from the document.body that has the name "theme".

Take a look in the source for an attribute data-theme="value" in the body tag.
0
 
netballiConnect With a Mentor Commented:
The Variable "theme" is being assigned a data attribute for theme,  the  $.data()  stores a reference to a variable, which could even be a global variable in a DOM element for the HTML page.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.