Populate
- 授权协议: 未知
- 开发语言:
- 操作系统: 未知
- 软件首页: http://plugins.jquery.com/project/Populate
软件介绍
Populate a form or an element’s child elements using a JSON object.
This plugin supports full PHP naming and deep data structures, as well as checkbox arrays and other non-standard UI controls. The plugin can be used as part of your AJAX toolkit, or for separating server-side code from HTML by populating a form after the page has loaded eg:
$('form').populate({'text':'text', 'radio':1})
and not inline as the page is processed, such as:
<input type="text" name="text" id="text" value="<?php echo $text; ?>" />
<input type="radio" name="radio" id="radio-1" checked="<?php echo $val == 1; ?>" />
<input type="radio" name="radio" id="radio-2" checked="<?php echo $val == 2; ?>" />Non-form elements
You can also populate non-form controls such as <div>s, by specifiying the id and an identifying attribute (defaults to id):
$('div').populate({'text-1':'text', 'text-2':'More text'})
This can be useful when you want to show the results of a database call, but don't want the text to be editable.
Usage
Just include the PHP JSON class, PHP helper function and of course Populate at the top of your page, and a PHP snippet such as this the bottom:
<?php populate('form', $data); ?/>
Which will output something meaningful like this:
$('form').populate({'text':'text', 'radio':1})
Live Demo
Finally!
I've now FINALLY put up a full set of instructions and a working demo, with examples of:
- Populating a simple form, using string variable types for textfields, radiobuttons, dropdowns and checkboxes
- Populating a complex form, using array variable types for checkbox arrays and multi-list boxes
- Populating a hierarchical form, using hierarchical JSON data
View the jQuery Populate Demo here.
Download
JavaScript
PHP
计算机真实感图形的算法基础
彭群生 / 科学出版社 / 1999-6 / 45.00元
《计算机真实感图形的算法基础》是系统介绍计算机真实感图形基础理论与算法的一本专著。全书共分九章,包括图形学基础、光照模型原理、简单画面绘制算法、光线跟踪、纹理映射、阴影生成、光能辐射度方法、实时图形绘制技术、自然景物仿真、颜色等。《计算机真实感图形的算法基础》的特点是内容全面,取材新颖,注重算法,力求实用。除系统叙述计算机真实感图形生成的基本概念、基本算法外,作者还注意结合亲身实践体会介绍国内外的......一起来看看 《计算机真实感图形的算法基础》 这本书的介绍吧!
正则表达式在线测试
正则表达式在线测试
HSV CMYK 转换工具
HSV CMYK互换工具
