日期:2014-05-20  浏览次数:20718 次

java登录由JS 生成的页面
html源代码


<title></title>
<style>
body {
    MARGIN: 0 0 0 0;
    background-color: #e1e9f4;
}
</style>
<META content="MSHTML 6.00.2800.1625" name=GENERATOR>
</head>

<body onload="init()" topmargin="0" leftmargin="0" bgcolor="#e1e9f4"> 
<form name="login" action="redirct_index.htm" method="post" onsubmit="return formSubmit2(this);">
<input type=hidden name=rtime>
<SCRIPT language=javascript> 
dis_login(); 
</SCRIPT> 
</form>
</body>
<SCRIPT language=JavaScript>



</SCRIPT>

</html>

HTML中就一个JS,JS中绘制登录框,JS源码


function dis_login() 
{
    document.write("<table width=100% height=90% border=0><tr><td align=center style='font-family: verdana,arial,sans-serif; font-size: 12px ;COLOR: #333333'><DIV class=da_width >"+ 
    "<DIV style='BACKGROUND: url(images/back.jpg); HEIGHT: 214px' id=dl_margin>"+ 
    "<DIV style='font-size: 14px; WIDTH: 280px; MARGIN-TOP: 0px; PADDING-TOP: 25px' align=center><b>"+productInfo+"</b></DIV>"+
    "<DIV style='MARGIN-TOP: 43px; FLOAT: left; WIDTH: 250px' align=right><IMG src='images/h3c_logo.jpg'>&nbsp;</DIV>"+ 
    "<DIV style='HEIGHT: 20px;WIDTH: 480px'></DIV>"+
    "<DIV align=left>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用户名 <INPUT TabIndex=1 style='BORDER-RIGHT: #87a6c3 1px solid; BORDER-TOP: #87a6c3 1px solid; BACKGROUND: #edeced; BORDER-LEFT: #87a6c3 1px solid; WIDTH: 115px; BORDER-BOTTOM: #87a6c3 1px solid; HEIGHT: 19px' "+
    "id='userName' name='userName' size='16' maxlength='32' onkeypress=\"move(event,'password');if(event.keyCode=='13'){return false;}\"></DIV>");
    if (0 == vldcode_en)
    {
        document.write('<DIV>&nbsp;</DIV>');
    }
    document.write("<DIV align=left>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;密 码 ");
    if (1 == vldcode_en)
    {
        document.write('<input TabIndex=2 id="password" name="password" size="16" maxlength="32" type="password" onkeypress="move(event,\'vldcode\');if(event.keyCode==13){return false;}" ');
    }
    else
    {
        document.write('<input TabIndex=2 id="password" name="password" size="16" maxlength="32" type="password" onkeypress="onEnterSub(event)" ');
    }
    document.write("style='BORDER-RIGHT: #87a6c3 1px solid; BORDER-TOP: #87a6c3 1px solid; BACKGROUND: #edeced; BORDER-LEFT: #87a6c3 1px solid; WIDTH: 115px; BORDER-BOTTOM: #87a6c3 1px solid; HEIGHT: 19px'>");
     
    document.write('<a href=javascript:void(0) onclick=popUserFaq("user_faq.htm?#_Toc286769551")> 忘记密码</a></DIV>');
      
    if (1 == vldcode_en)
    {
        document.write("<DIV align=left>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;验证码 <INPUT TabIndex=3 style='BORDER-RIGHT: #87a6c3 1px solid; BORDER-TOP: #87a6c3 1px solid; BACKGROUND: #edeced; BORDER-LEFT: #87a6c3 1px solid; WIDTH: 115px; BORDER-BOTTOM: #87a6c3 1px solid; HEIGHT: 19px'"); 
        document.write('id="vldcode" name="vldcode" size="16" maxlength="4" type="text" onkeypress="onEnterSub(event)" >');
        document.write('<img id=vldimp src="images/vld.bmp" alt="刷新验证码" onclick=get_vldbmp() style="cursor:pointer"/></DIV>');
    }
    document.write("<span name='messages' id=messages style='HEIGHT:3px; MARGIN-TOP: 0px; MARGIN-LEFT: 20px; WIDTH: 200px; PADDING-TOP: 8px; FLOAT: left;'></span>"+ 
    "<br><br>");
    if (1 == vldcode_en)
    {
        document.write("<DIV style='WIDTH: 80px; MARGIN-TOP: 0px; PADDING-TOP: 12px;'><input TabIndex=4 type='submit' value='  登录  '></DIV>");