Web/Js/public.js

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

function correctPNG()
{
  for(var i=0; i<document.images.length; i++)
  {
   var img = document.images[i]
   var imgName = img.src.toUpperCase()
   if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
   {
   var imgID = (img.id) ? "id='" + img.id + "' " : ""
   var imgClass = (img.className) ? "class='" + img.className + "' " : ""
   var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
   var imgStyle = "display:inline-block;" + img.style.cssText
   if (img.align == "left") imgStyle = "float:left;" + imgStyle
   if (img.align == "right") imgStyle = "float:right;" + imgStyle
   if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
   var strNewHTML = "<span " + imgID + imgClass + imgTitle
   + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
   + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
   + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
   img.outerHTML = strNewHTML
   i = i-1
   };
  };
};
if(navigator.userAgent.indexOf("MSIE")>-1)
{
window.attachEvent("onload", correctPNG);
};



//只能输入数字,目前可以输入中文,待解决
function fnNumbericeOnlySet() {
    if (!KeyIsNumber(event.keyCode)) {
        event.returnValue = false;
    }
}

function KeyIsNumber(KeyCode) {
    if (((KeyCode > 47) && (KeyCode < 58)) || (KeyCode == 8) || (KeyCode == 46)) {
        return true;
    }
    else {
        return false;
    }
}


//通用js form表单验证,需prototype1.5支持
/*
** needInputs: 需要验证的控件id数组                                    | 例:['txtName', 'txtAge', 'txtPwd']
** describeFields: 需要对应needInputs,描述信息                        | 例:['用户名', '年龄', '密码']
** exceptByEdit: 在表单功能为修改时,是否继续验证控件,与needInputs对应| 例:[true, true, false]
** id: 表单对象id,用来判断当前表单是新增还是修改操作 
*/
function fnCommChkForm(needInputs, describeFields, exceptByEdit, id) {
    var f = true;

    needInputs.each(function(name, index) {
        if (!$F(name)) {
后面还有 41 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。