Autofill
- 授权协议: 未知
- 开发语言:
- 操作系统: 未知
- 软件首页: http://plugins.jquery.com/project/Autofill
软件介绍
This plugin offers the ability to auto fill form.
If the first parameter is an URL, the plugin will fetch the returned JSON object via AJAX. Or you can pass a pre-fetched JSON object so that no AJAX will be performed.
The second parameter is an object containing other options.
type - AJAX request type
data - Data to be sent to the server
errorTrigger - if the JSON object contains this as its key, error callback will be triggered. Useful if server side returns a custom error message
mSelectCheckName - Default to false.
True: look for multiple select boxes with their name.
False: look for multiple select boxes with their IDajaxError - callback function for AJAX error
error - error callback if the JSON object is empty, or contains errorTrigger as its key
beforeFillForm - callback function to be executed before start filling the form
beforeFill - callback function to be executed BEFORE filling a form element
afterFill - callback function to be executed AFTER filling a form element
complete - callback function to be executed when all form elements have been filled
Basi Example with pre-fetched data
var data = { username: 'peter', gender: 'M' };
$('form').autoFill(data);
Full Example using AJAX:
$('form').autoFill('get_data.php',
{
type: 'GET', // AJAX request method
data: { record_id: 2 }, // Request parameters
// if the JSON object contains this key,
// error callback will be triggered.
// Useful if server side returns a custom error message
errorTrigger: 'error',
// Default to false.
// True: look for multiple select boxes with their name
// False: look for multiple select boxes with their ID
mSelectCheckName: false,
ajaxError: function(error, form)
{
// do something if AJAX error occurs
alert(error);
$(form).hide();
},
error: function(form)
{
// do something if error occurs
alert('Unable to fill form!');
$(form).hide();
},
beforeFillForm: function(form)
{
// do something before start filling the form
$(form).show();
},
beforeFill: function(key, value, form)
{
// do something BEFORE filling an element
if(key == 'password')
return false; // return false to skip current form element
if(key == 'gender' && value == 'female')
alert("OH! She's a lady!");
},
afterFill: function(key, value, form)
{
// do something AFTER filling an element
if(value == 'blah')
confirm('What are you talking about?');
if(key == 'zip' && value == '')
return false; // return false to skip all pending form elements
},
complete: function(processed, form)
{
// do something when all elements have been filled
alert(processed + ' elements have been filled!');
}
});
文明之光(第一册)
吴军 / 人民邮电出版社 / 2014-6-25 / 59.00元
人类的历史,是从野蛮蒙昧一步步走向文明进步的过程。在文明的进程中,人类创造出多元的文化,它们有着各自的特长。要实现人类和平发展的终极理想,一个重要的前提是承认文化的多元性,并且取长补短,相互融合。 吴军博士写作《文明之光》系列,希望能开阔人们的视野,让我们看到各种各样的人类文明。虽然今天不同的地区发达程度不同,文明历史的长短不一,国家亦有大小之分,但是文明之光从世界的每一个角落发出,对人类的......一起来看看 《文明之光(第一册)》 这本书的介绍吧!
