【发布时间】:2013-10-04 12:16:52
【问题描述】:
我的一位大学教授帮助我创建了这个函数。它通过将#txtNewPassword 字段的值解析为“checkpasslength.php”文件来检查密码的长度,该文件处理数据并根据$.post() 中数据的长度/内容返回一个值。 ...我不明白的唯一部分是 $.post() 函数的第二个参数... reg.password.value 究竟做了什么?我几乎知道它的作用(在每次按键时发送表单中的值),但是 .reg 是什么意思?
$(document).ready(function() {
$('#checkPassLength').load('checkpasslength.php').show();
$('#txtNewPassword').keyup(function() {
$.post('checkpasslength.php', {password: reg.password.value},
function(result) {
$('#checkPassLength').html(result).show();
});
});
});
【问题讨论】:
-
reg..的值是多少??? -
reg 来自哪里??
-
在
keyup方法中使用console.log(reg)并找出自己!