Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


what's the meaning of this

Posted on 2013-02-04
Medium Priority
Last Modified: 2013-02-04
var theme =  $.data(document.body, 'theme');

Thanks in advance
Question by:gamjaradio
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 17

Assisted Solution

sonawanekiran earned 500 total points
ID: 38850639
Go through this link you will get an idea about .data()
LVL 12

Assisted Solution

HugoHiasl earned 500 total points
ID: 38850646
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.
LVL 11

Assisted Solution

netballi earned 500 total points
ID: 38850659
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.

Accepted Solution

Php_expert earned 500 total points
ID: 38850854
Refer this link for more information about data storage using jQuery:

Featured Post

Quick Cloud Training

Looking for some quick training on the cloud in 2 hours or less? Check out these how-to guides in AWS, Linux, OpenStack, Azure, and more!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question