⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin.js

📁 演示中使用的数据库为省、市、县三级数据库 演示程序实现了省、市、县三级联动(ajax技术) 程序调用方法: 1:把 <script language="javascript" src="
💻 JS
字号:
function killerr() {return true}  
window.onerror=killerr 

function oCopy(str)
{
var clipBoardContent=str;
window.clipboardData.setData("Text",clipBoardContent);
alert("代码复制成功,代码内容为:\n\n"+str+"\n\n您可以将此代码粘贴到您想插入本内容的位置");
}


//选取所有
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }

//设定图片显示尺寸
var flag=false; 
function DrawImage(ImgD,w,h){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= w/h){ 
if(image.width>w){ 
ImgD.width=w; 
ImgD.height=(image.height*w)/image.width; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
/*ImgD.alt=image.width+"×"+image.height;*/ 
} 
else{ 
if(image.height>h){ 
ImgD.height=h; 
ImgD.width=(image.width*h)/image.height; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
/*ImgD.alt=image.width+"×"+image.height;*/ 
} 
} 
/*else{ 
ImgD.src=""; 
ImgD.alt="" 
}*/ 
} 

function statusmove(str){
self.status = str;
}
function statusover(){
self.status = '';
}

function show(i,n,t){     
if (i.style.display == "none") {     
		i.style.display = "";
		n.style.display = "";
		t.style.background = "url('image/Menu_BG.gif')";
	}else{     
		i.style.display = "none";
		n.style.display = "none";
		t.style.background = "url('image/Menu_BG1.gif')";
	}     
}	     

function TopType(){
if(Top.style.display == ""){
Top.style.display = "none";
TopPic.src="image/p_5.gif"
}else{
Top.style.display = "";
TopPic.src="image/p_6.gif"
}
}

function MenuType(){
if(menu.style.display == ""){
menukey.innerHTML = ">> 显示菜单";
menu.style.display = "none";
}else{
menukey.innerHTML = "<< 隐藏菜单";
menu.style.display = "";
}
}




//菜单书签
function menudis(tit,show,font,num){
  for(g=1;g<=num;g++){
	document.all("show"+g).style.display="none";
	document.all("tit"+g).className="mLabel";
	document.all("titfont"+g).className="mLabeltit";
  }
  if(tit.style.display=="none"){
	show.style.display="none";
	tit.className="mLabel";
	font.className="mLabeltit";
	}
	else{
	show.style.display="";
	tit.className="mLabel1";
	font.className="mLabeltit1";
	}
}

//后台书签
function dis(tit,show,num,pic){
  for(g=1;g<=num;g++){
	document.all("tit"+g).background="image/"+pic+"_1.gif";
	document.all("show"+g).style.display="none";
	document.all("tit"+g).className="Label";
  }
  if(tit.style.display=="none"){
    tit.background="image/"+pic+"_1.gif";
	show.style.display="none";
	tit.className="Label";
	}
	else{
	tit.background="image/"+pic+".gif";
	show.style.display="";
	tit.className="Label1";
	}
}

//System_Templates.asp
function temp(i,n){     
if (n.style.display == "none") {     
		i.src = "image/-.gif";
		n.style.display = "";
	}else{     
		i.src = "image/+.gif";
		n.style.display = "none";
	}     
}	     

// 显示无模式对话框
function ShowDialog(url, width, height) {
	var arr = showModalDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:no;status:no");
}

function preview() /* Preview for the "Compilation" */
	{
		if(document.myform.HtmlCode.value.length>0)
			{
				pr=window.open("","Preview","scrollbars=1,width=800,height=500");
				pr.document.write(document.myform.HtmlCode.value);
			}
		else alert('无任何内容可供预览!')
}



function Keyword(addKeyword) { 
var revisedTitle; 
var currentTitle = document.myform.f_Keyword.value; 
if (addKeyword!=""){
if (currentTitle==""){
revisedTitle = addKeyword; 
}else{
revisedTitle = addKeyword+","+currentTitle; 
}
}else{
revisedTitle="";
}
document.myform.f_Keyword.value=revisedTitle; 
}

/*标签添加输出格式选择*/
function Label(i){
  switch(i){
    case "1":
      table.style.display = "none";
      div.style.display = "none";
	  break;
    case "2":
      table.style.display = "";
      div.style.display = "none";
	  break;
    case "3":
      table.style.display = "none";
      div.style.display = "";
	  break;
  }
}

/*标签添加输出格式选择*/
function Label2(i){
  switch(i){
    case "1":
      table1.style.display = "";
      div1.style.display = "none";
      table2.style.display = "";
      div2.style.display = "none";
	  break;
    case "2":
      table1.style.display = "none";
      div1.style.display = "";
      table2.style.display = "none";
      div2.style.display = "";
	  break;
  }
}

//居中打开窗口
function openwindow( url, winName, width, height) {
xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 )){
xposition = (screen.width - width) / 2;
yposition = (screen.height - height) / 2;}
theproperty= "width=" + width + "," 
+ "height=" + height + "," 
+ "location=0," 
+ "menubar=0,"
+ "resizable=1,"
+ "scrollbars=0,"
+ "status=0," 
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //仅适用于Netscape
+ "screeny=" + yposition + "," //仅适用于Netscape
+ "left=" + xposition + "," //IE
+ "top=" + yposition; //IE 
window.open( url,winName,theproperty );
}

function ShowTimingType(num){ 
   switch(num){
     case "0":     
        document.myform.WeekDay.style.display='none';
        break;
     case "1":     
        document.myform.WeekDay.style.display='';
        break;
     default:
        alert("错误参数调用!");
        break;
    }
}

//ajax提示框功能
var Obj=''
document.onmouseup=MUp
document.onmousemove=MMove

function MDown(Object){
Obj=Object.id
document.all(Obj).setCapture()
pX=event.x-document.all(Obj).style.pixelLeft;
pY=event.y-document.all(Obj).style.pixelTop;
}

function MMove(){
if(Obj!=''){
  document.all(Obj).style.left=event.x-pX;
  document.all(Obj).style.top=event.y-pY;
  }
}

function MUp(){
if(Obj!=''){
  document.all(Obj).releaseCapture();
  Obj='';
  }
}



function Add(str) {
	var sel2=document.myform.PicSelect;
	sel2.options[sel2.length]=new Option(str,str);
	sel2.selectedIndex = sel2.length-1;
}

function PicReset(str){
document.myform.Pic.value = str;
if (str == ""){
PicPreview.innerHTML = "<Img src=../Images/nopic.gif onload=\'DrawImage(this, 118, 118);\'>";
}else{
PicPreview.innerHTML = "<Img src="+str+" onload=\'DrawImage(this, 118, 118);\'>";
}
}



function sift(){
  if (myform.c.value !=""){
    if (myform.c.value == "|||"){
	  myform.c.value = "";
      myform.c.focus();
      alert('条件不能为“|||”');
	}else{
      var sift;
      var siftv = myform.e5.value;
      sift = myform.a.children[myform.a.selectedIndex].text + '|||' + myform.b.children[myform.b.selectedIndex].text + '|||'  + myform.c.value;
      if(siftv.indexOf(sift)!=-1){
	    alert('此过滤器规则在下面列表中已存在');
	    myform.c.focus();
	    return false;
	  }
	  if (siftv!=""){
	    myform.e5.value =  myform.e5.value+'\n'+sift;
	  }else{
	    myform.e5.value =  sift;
	  }
	  myform.c.value = "";
	  myform.c.focus();
	}
  }else{
    myform.c.focus();
    alert('条件不完整');
  }
}

/*打开选项控制示例*/
var Skey
Skey=0;
function Select(){
  if(Skey==0){
    Skey=1;
    SelectPic.style.display="";
  }else{
    Skey=0;
    SelectPic.style.display="none";
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -