Update page using JSON data
updateWithJSON is a jQuery plugin that updates elements on your page based on key/value pairs in a JSON object. Here's how it works:
* iterate over each property/value combination in the JSON object
* look for an element in the DOM that matches the property name
o first, look for an element with a matching id attribute
o if no element with a matching ID is found, look for input, select or textarea elements with a matching name attribute
* update the value, contents or selection of the matched element(s) based on the value in the JSON object
Usage: $.updateWithJSON(data)
评论