SoFunction
Updated on 2025-04-10

b/s development commonly used javascript technology page 3/4


3.8 Determine file type during file upload
<input type=file onchange="alert((/^(.*)(\.)(.{1,8})$/)[3])">

Drawing:
<OBJECT 
id=S 
style="LEFT: 0px; WIDTH: 392px; TOP: 0px; HEIGHT: 240px" 
height=240 
width=392 
class>
</OBJECT>
<SCRIPT>
(0,0,0,30,50,60);
(30,0,0,30,50,60);
(10,10,100,100);
</SCRIPT>

Write the registry:
<SCRIPT>
var WshShell = ("");
 ("HKCU\\Software\\ACME\\FortuneTeller\\", 1, "REG_BINARY");
 ("HKCU\\Software\\ACME\\FortuneTeller\\MindReader", "Goocher!", "REG_SZ");
var bKey =     ("HKCU\\Software\\ACME\\FortuneTeller\\");
 ( ("HKCU\\Software\\ACME\\FortuneTeller\\MindReader"));
 ("HKCU\\Software\\ACME\\FortuneTeller\\MindReader");
 ("HKCU\\Software\\ACME\\FortuneTeller\\");
 ("HKCU\\Software\\ACME\\");
</SCRIPT>

TABLAE related (client dynamically increases ranks)
<HTML>
<SCRIPT LANGUAGE="JScript">
function numberCells() {
    var count=0;
    for (i=0; i < ; i++) {
        for (j=0; j < (i).; j++) {
            (i).cells(j).innerText = count;
            count++;
        }
    }
}
</SCRIPT>
<BODY onload="numberCells()">
<TABLE id=mytable border=1>
<TR><TH> </TH><TH> </TH><TH> </TH><TH> </TH></TR>
<TR><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR>
<TR><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR>
</TABLE>
</BODY>
</HTML> 

1. Strict verification of ID card:

<script>
var aCity={11:"Beijing",12:"Tianjin",13:"Hebei",14:"Shanxi",15:"Inner *",21:"Liaoning",22:"Jilin",23:"Heilongjiang",31:"Shanghai",32:"Jiangsu",33:"Zhejiang",34:"Anhui",35:"Fujian",36:"Jiangxi",37:"Shandong",41:"Henan",42:"Hu North",43:"Hunan",44:"Guangdong",45:"Guangxi",46:"Hainan",50:"Chongqing",51:"Sichuan",52:"Guizhou",53:"Yunnan",54:"Tibet",61:"Shaanxi",62:"Gansu",63:"Qinghai",64:"Ningxia",65:"*",71:"*",81:"*",82:"Macao",91:"Foreign"}

function cidInfo(sId){
 var iSum=0
 var info=""
 if(!/^\d{17}(\d|x)$/(sId))return false;
 sId=(/x$/i,"a");
if(aCity[parseInt((0,2))]==null)return "Error:Illegal area";
 sBirthday=(6,4)+"-"+Number((10,2))+"-"+Number((12,2));
 var d=new Date((/-/g,"/"))
if(sBirthday!=(()+"-"+ (()+1) +"-" + ()))return "Error: Illegal birthday";
 for(var i = 17;i>=0;i --) iSum += ((2,i) % 11) * parseInt((17 - i),11)
if(iSum%11!=1)return "Error:Illegal certificate number";
return aCity[parseInt((0,2))]+","+sBirthday+","+((16,1)%2?"Male":"Female")
}

(cidInfo("380524198002300016"),"<br/>");
(cidInfo("340524198002300019"),"<br/>")
(cidInfo("340524197711111111"),"<br/>")
(cidInfo("34052419800101001x"),"<br/>");
</script>

2. Verify IP address
<SCRIPT LANGUAGE="java script">
function isip(s){
 var check=function(v){try{return (v<=255 && v>=0)}catch(x){return false}};
 var re=(".")
 return (==4)?(check(re[0]) && check(re[1]) && check(re[2]) && check(re[3])):false
}

var s="202.197.78.129";
alert(isip(s))
</SCRIPT>

 

3. A borderless window that can still be used after adding sp1! !
<HTML XMLNS:IE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<IE:Download ID="include" STYLE="behavior:url(#default#download)" />
<title>Chromeless Window</title>

<SCRIPT LANGUAGE="JScript">
/*--- Special Thanks For andot ---*/

/*
 This following code are designed and writen by Windy_sk <seasonx@>
 You can use it freely, but u must held all the copyright items!
*/

/*--- Thanks For andot Again ---*/

var CW_width = 400;
var CW_height = 300;
var CW_top = 100;
var CW_left = 100;
var CW_url = "/";
var New_CW = ();
var CW_Body = New_CW.;
var content = "";
var CSStext = "margin:1px;color:black; border:2px outset;border-style:expression(onmouseout=onmouseup=function(){='outset'}, onmousedown=function(){if(!=2)='inset'});background-color:buttonface;width:16px;height:14px;font-size:12px;line-height:11px;cursor:Default;";

//Build Window
(CW_url, function(source){content=source});

function insert_content(){
 var temp = "";
 CW_Body.  = "hidden";
 CW_Body. = "white";
 CW_Body.  =  "solid black 1px";
 content = (/<a ([^>]*)>/g,"<a onclick='();return false' $1>");
 temp += "<table width=100% height=100% cellpadding=0 cellspacing=0 border=0>";
 temp += "<tr style=';font-size:12px;background:#0099CC;height:20;cursor:default' ondblclick=\"==='1'?'2':'1';parent.if_max=!parent.if_max;parent.show_CW();\" onmouseup='parent.drag_up(event)' onmousemove='parent.drag_move(event)' onmousedown='parent.drag_down(event)' onselectstart='return false' oncontextmenu='return false'>";
 temp += "<td style='color:#ffffff;padding-left:5px'>Chromeless Window For IE6 SP1</td>";
 temp += "<td style='color:#ffffff;padding-right:5px;' align=right>";
 temp += "<span id=Help  onclick=\"alert('Chromeless Window For IE6 SP1  -  Ver 1.0\\n\\nCode By Windy_sk\\n\\nSpecial Thanks For andot')\" style=\""+CSStext+"font-family:System;padding-right:2px;\">?</span>";
 temp += "<span id=Min   onclick='parent.New_CW.hide();()' style=\""+CSStext+"font-family:Webdings;\" title='Minimum'>0</span>";
 temp += "<span id=Max   onclick=\"==='1'?'2':'1';parent.if_max=!parent.if_max;parent.show_CW();\" style=\""+CSStext+"font-family:Webdings;\" title='Maximum'>1</span>";
 temp += "<span id=Close onclick='=null;()' style=\""+CSStext+"font-family:System;padding-right:2px;\" title='Close'>x</span>";
 temp += "</td></tr><tr><td colspan=2>";
 temp += "<div id=include style='overflow:scroll;overflow-x:hidden;overflow-y:auto; HEIGHT: 100%; width:"+CW_width+"'>";
 temp += content;
 temp += "</div>";
 temp += "</td></tr></table>";
 CW_Body.innerHTML = temp;
}

setTimeout("insert_content()",1000);

var if_max = true;
function show_CW(){
 (10000, 10000);
 if(if_max){
  New_CW.show(CW_top, CW_left, CW_width, CW_height);
  if(typeof(New_CW.)!="undefined"){
   New_CW. = CW_width;
   New_CW. = "1";
  }

 }else{
  New_CW.show(0, 0, , );
  New_CW. = ;
 }
}

  = show_CW;
 = show_CW;

// Move Window
var drag_x,drag_y,draging=false

function drag_move(e){
 if (draging){
  New_CW.show(-drag_x, -drag_y, CW_width, CW_height);
  return false;
 }
}

function drag_down(e){
 if(==2)return;
 if(New_CW.== && New_CW.==)return;
 drag_x=;
 drag_y=;
 draging=true;
 ();
}

function drag_up(e){
 draging=false;
 ();
 if(New_CW.== && New_CW.==) return;
 CW_top  = -drag_x;
 CW_left = -drag_y;
}

</SCRIPT>
</HTML>
Previous page1234Next pageRead the full text