当前位置:编程学习 > VB >>

提交本页

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
function btnAct() {
var para = arguments;
var o = para[0];
if(o.className.indexOf("_disable")>0)
{
return false;
}
if(para[1])
{
var callback = para[1];
if(para.length>2)
{
var paraArr = new Array();
for(var i=2; i<para.length; i++)
{
paraArr.push(para[i]);
}
callback.apply(this, paraArr);
}
else
{
callback();
}
}
};
$(function() {
function checkFlash() {
try {
if ($.browser.msie) {
if (new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) {
return;
}
} else if ($.browser.mozilla) {
if (navigator.plugins["Shockwave Flash"]) {
return;
}
} else {
// other browsers, there is no flash player support
return;
}
} catch(e) {}
var html = '<table id="flashDownloader" width="740px" align="center" cellpadding="0" cellspacing="6"';
html += ' style="border: 1px solid #999999; margin-top: 5px;" bgcolor="#F8F8F0"><tr valign="top">'; --------------------编程问答-------------------- html += '<td width="16px"><img src="/backup/theme/default/images/icon/message.info.small.png"></td>';
html += "<td>${bme:i18n('com.huawei.oms.homepage.login.flash')} <a href=\"/backup";
if ($.browser.msie) {
html += '/install_flash_player_for_ie.zip';
} else {
html += '/install_flash_player_for_firefox.zip';
}
html += '">FlashPlayer v10.1</a></td></tr></table>';
$(html).insertBefore("#login");
}
    $('#login').alignMiddle(100);
checkFlash();
    $('#loginErrorMsg').removeClass("icon_error");
    var options = {
        rules: {
            username: {
                required: true
            },
            password: {
                required: true
            }
        },
        messages: {
            username: {
                required: "${bme:i18n('BME.LOGIN.USERNOTNULL')}"
            },
            password: {
                required: "${bme:i18n('BME.LOGIN.PASSNOTNULL')}"
            }
        },
        showErrors: function(errorMap, errorList) {
            if (this.numberOfInvalids())
            {
                // only display the last error message
                var errorMsg;
                if (this.errorList.length)
                {
                    errorMsg = this.errorList[0].message;
                }
                else
                {
                    var lastEleName;
                    for (var name in this.invalid)
                    {
                        lastEleName = name;
                    }
                    errorMsg = this.submitted[lastEleName];
                }
                
                $('#loginErrorMsg').text(errorMsg);
                $('#loginErrorMsg').addClass("icon_error");
                $(".login_error").show();
            }
            else
            {
             $('#loginErrorMsg').text("");
             $('#loginErrorMsg').removeClass("icon_error");
                //$(".login_error").hide();
            }
        },
        // specifying a submitHandler prevents the default submit
        submitHandler: function() {
            checkLoginAndSubmit();
        },
onsubmit: true
    };
// delete default validator created in jquery.bme.validate.js
    $(document.body).removeData('validator');
    validator = $(document.body).validate(options);
    validator = $('#loginForm').validate(options);
//Press <Enter> or <Space> key to submit login form when Submit button is focus
    $("#submitBtn").bind("keypress", function(e) {
        if( e.which==13|| e.which==32)
        {
         $(this).click();
        }
    });
})
function submitLogin() {
$("#username").blur();
    $("#password").blur();
    $("#loginForm").submit();
}
function checkLoginAndSubmit() {

    var usernameInp = $("#username").val();
     var passwordInp = $("#password").val();
$.ajax({url:"loginServlet", 
        data:({username:usernameInp, password:passwordInp}),
        type: "POST",
        cache: "false",
        success: function(str)
        {
         if("yes"==str)
       {
        forwardUrl("index.jsp");
       }
   }
    });
}
document.onkeydown = function(event)
{
    if (!event)
    {
     event = window.event;
    }
    var keycode = $.browser.mozilla?event.which:event.keyCode;
    if(keycode == 13)
    {
        submitLogin();
        return false;
    }
}
</script>
<%
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);
%>
</head>
<body class="login_body"><form id="loginForm" name="loginForm" action="" method="post"/>
</body></html>
--------------------编程问答--------------------  native , synchronized :http://futureinhands.iteye.com/blog/213657, http://www.iteye.com/topic/72543
package com.oss.engineering.base.os.impl;
public Windows()
   {
      File nativeFile = new File(OSAdpaterImpl.libPathForOS + 
       "/installdisk.dll");//dll中对对应的java包名与类名有指定;
System.load(nativeFile.getAbsolutePath()); 
}  --------------------编程问答-------------------- Reader reader = 
 Resources.getResourceAsReader(IBatisMgr.class.getClassLoader(), 
 "conf/SqlMapConfig.xml");
补充:VB ,  非技术类
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,