I can’t make out what these 2 lines mean:
var template = $("#" + model + " #grid #template").clone();
var templateHtml = $("#templatebody", template).html();
I can’t understand the selectors here.I know what clone() and html() do
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is looking for an element with the
idoftemplateinside an element idgrid, inside and element with theidwhich is set in themodelvariable.For example, if
modelwas the string: ‘container’:This is a ‘context’ selector; it is looking for the
#templatebodyelement inside the element which is contained in thetemplatevariable. Note that a context selector is irrelevant in this case as there should only ever be one element in a given page with a setid.Example