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)