terryds Posted August 20, 2013 Share Posted August 20, 2013 (edited) $("p:first").data("test","This is some data.");var p = $("p:first").detach();console.log("Data stored: "+p.data("test")); What does the "+p.data("test"))" mean ? Edited August 20, 2013 by terryds Link to comment Share on other sites More sharing options...
Don E Posted August 20, 2013 Share Posted August 20, 2013 The plus sign in Javascript (jQuery as well I'm sure) means to concatenate. Like how the dot in PHP is to concatenate, in JavaScript the plus sign is for that. The above would output: "Date stored: This is some data" I believe(not too familiar with jQuery). 1 Link to comment Share on other sites More sharing options...
thescientist Posted August 20, 2013 Share Posted August 20, 2013 it is a Javascript operator that will either concatenate or add, depending on the context. http://www.w3schools.com/js/js_operators.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now