Is the correct usage? Which one you need to use. Below I share the sample codes. I need a recommendation for.
{
"__bc" : 1,
"_payload" : null,
"_plugin" : [.........],
"_debug" : "on",
"_content" : [
"html":{<form name=\"signin\" id=\"signin\" action=\"javascript:;\" onsubmit=\"return false\"><label id=\"username\">username:</label> <input type=\"text\" name=\"username\" id="\username\"/></form>}
]
}
or standart html;
<form name="signin" id="signin" action="javascript:;" onsubmit="return false">
<label id="username">username:</label> <input type="text" name="username" id="username"/>
</form>
I would use JSON. You want to keep the markup separate. jQuery has a function
.data(key,value)for storing values in the DOM.For example:
This stores a JSON in the form element. It is retrieved by specifying the key:
$(‘form’).data(form data); //returns {name: “signin”, id: “signing”}
You should get the general idea from this example. The documentation for
.data(key,value)is here.Hope this helps.