标签:pwd mit val log method word eventid alert set
var form=document.createElement("FORM");
// 设置属性
form.setAttribute("action","<%=pt.get("cas.url")%>/login");
form.setAttribute("method",‘post‘);
// 创建Input
var name_input = $(‘<input type="text" name="username" />‘);
name_input.attr(‘value‘, name);
var pwd_input = $(‘<input type="text" name="password" />‘);
pwd_input.attr(‘value‘, pwd);
var isajax_input = $(‘<input type="text" name="isajax" />‘);
isajax_input.attr(‘value‘, true);
var lt_input = $(‘<input type="text" name="lt" />‘);
lt_input.attr(‘value‘, lt);
var _eventId_input = $(‘<input type="text" name="_eventId" />‘);
_eventId_input.attr(‘value‘, "submit");
// 附加到Form
form.append(name_input);
form.append(pwd_input);
form.append(isajax_input);
form.append(lt_input);
form.append(_eventId_input);
form.append("</form>");
alert(form.html);
document.body.appendChild(form);
// 提交表单
form.submit();
标签:pwd mit val log method word eventid alert set
原文地址:http://www.cnblogs.com/lengzhijun/p/7795369.html