$(document).keypress(function(e)
{
switch(e.which)
{
case
13: if(g_flag == "login"){validateLoginForm();}
else if(g_flag == "register"){validateRegForm(); }
break;
}
});
原文地址:http://www.cnblogs.com/Rachel0829/p/3765320.html