Update page using JSON data

联合创作 · 2023-10-02 15:06

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)

浏览 8
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报