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

📄 bookmall.js

📁 此为ASP+SQL 2000做的网上书店管理系统 功能还行
💻 JS
字号:
function checksel(obj){	var checksign = false;	if(obj == null){		alert("没有可用记录!");		return checksign;	}	if(obj.length > 1){		for(var i = 0;i < obj.length;i++){			if(obj[i].checked){				checksign = true;				break;			}		}	}else{		if(obj.checked){			checksign = true;		}	}	if(!checksign){		alert("请选中一条记录!");	}	return checksign;}function checkEmail(obj){	var checksign = true;	var emailvalue = obj.value;	if(emailvalue == null || emailvalue.length == 0){		checksign = false;	}else if(emailvalue.indexOf(' ') != -1){		checksign = false;		}else if(emailvalue.indexOf('@') == -1 || emailvalue.indexOf('.') == -1){				checksign = false;			}else if(emailvalue.substring(0,emailvalue.indexOf('@')).length == 0 || emailvalue.substring(emailvalue.indexOf('@') + 1).length == 0){				checksign = false;				}else if(emailvalue.substring(emailvalue.indexOf('.') + 1).length == 0){					checksign = false;					}else if(emailvalue.indexOf('@') > emailvalue.indexOf('.')){						checksign = false;						}	if(!checksign){		alert("您输入的Email格式不对!");		obj.focus();		obj.select();	}	return checksign;}function checkisnull(obj,msg){	var checksign = true;	if(obj.value.length == 0){		alert(msg + "不能为空!")		obj.focus();		checksign = false;	}	return checksign;}function checkisselected(obj,msg){	var checksign = true;	if(obj.selectedIndex == 0){		alert("请选择" + msg)		obj.focus();		checksign = false;	}	return checksign;}function gopagep(gocur){   var x=document.nextpage   if(x.KHcurRow!="undefined")      {x.KHcurRow.value=gocur;       x.submit();      }}function del(alias,alarm){ var r=document.nextpage.prodno; var clk=false; 	 var a = 0;         	             	if (isNaN(parseInt(r.length))){ 	  clk=r.checked; 	}else{   	  for(i=0;i<r.length;i++){if (r[i].checked){clk=true;i=r.length;}} 	} 	if (clk==true){ 	  if(confirm("是否真要删除?")) { 	  document.nextpage.TASK_ALIAS.value = alias;   	  document.nextpage.submit(); 	  } 	}else{ 	  alert(alarm); 	}	 }function check_tmp(shopper,theform,flag,rowcount){theform.KHcurRow.name="curRow";var f=0;if (rowcount>1){		for (i=0;i<rowcount;i++){		if (khGetElementsValueByName(prodno,i,check)==true)		{		f=1;		i=rowcount;		}	}}else{	if (khGetElementsValueByName(prodno,0,check)==true){		f=1;	}}if (f==1){	if (shopper!=null && shopper!=""){			if (rowcount>1){			var i=0;			if (flag==1){				khGetElementsValueByName(TASK_ALIAS,0)="shopcart";				for (i=0;i<rowcount;i++){					if (khGetElementsValueByName(prodno,i,check)==true){						theform.vent[i].name="prvent";					}else{						theform.vent[i].name="vent";					}				}			}else if (flag==2){				theform.TASK_ALIAS.value="collect";				for (i=0;i<rowcount;i++){					theform.prodno[i].name="colprodno";				}			}			theform.submit();		}else{			if (flag==1){				theform.vent.name="prvent";				theform.TASK_ALIAS.value="shopcart";			}else if (flag==2){				theform.TASK_ALIAS.value="collect";				theform.prodno.name="colprodno";			}			theform.submit();		}	}else{		newwin=self.open("/bookmall/login_sm.htm","login","width=320 height=150 resizable=no");		newwin.focus();	}}else{	if (flag==1){		alert('请选择要购买的书籍!');	}else{		alert('请选择要收藏的书籍!');	}}}function checklog(shopper){	if (shopper!=null && shopper!=""){		return true;	}else{		newwin=open("/bookmall/login_sm.htm","login","width=320 height=150 resizable=no");		newwin.focus();		return false;	}}function check_old(shopper,theform,flag,rowcount){theform.KHcurRow.name="curRow";var f=0;if (rowcount>1){		for (i=0;i<rowcount;i++){		if (theform.prodno[i].checked==true)		{		f=1;		i=rowcount;		}	}}else{	if (theform.prodno.checked==true){		f=1;	}}if (f==1){	if (checklog(shopper)){			if (rowcount>1){			var i=0;			if (flag==1){				theform.TASK_ALIAS.value="shopcart";				for (i=0;i<rowcount;i++){					if (theform.prodno[i].checked==true){						theform.vent[i].name="prvent";					}else{						theform.vent[i].name="vent";					}				}			}else if (flag==2){				theform.TASK_ALIAS.value="collect";				for (i=0;i<rowcount;i++){					theform.prodno[i].name="colprodno";				}			}			theform.submit();		}else{			if (flag==1){				theform.vent.name="prvent";				theform.TASK_ALIAS.value="shopcart";			}else if (flag==2){				theform.TASK_ALIAS.value="collect";				theform.prodno.name="colprodno";			}			theform.submit();		}	}}else{	if (flag==1){		alert('请选择要购买的书籍!');	}else{		alert('请选择要收藏的书籍!');	}}}function check(shopper,theform,flag,rowcount){var alias=theform.TASK_ALIAS.value;if (checklog(shopper)){		if (rowcount>1){		var i=0;		var f=0;		for (i=0;i<rowcount;i++){			if (theform.prodno[i].checked==true)				{f=1;}		}		if (f==0){			if (flag==1){				alert('请选择要购买的商品!');			}else{				alert('请选择要收藏的商品!');			}		}else{			if (flag==1){				for (i=0;i<rowcount;i++){					if (theform.prodno[i].checked==true){						theform.vent[i].name="prvent";					}else{						theform.vent[i].name="vent";					}				}				newwin=open("/loading.htm","shoplist","width=400 height=300");				theform.TASK_ALIAS.value="shopcart";				theform.target="shoplist";				newwin.focus();			}else if (flag==2){				theform.target="_self";				theform.TASK_ALIAS.value="collect";				for (i=0;i<rowcount;i++){					theform.prodno[i].name="colprodno";				}			}			theform.submit();		}	}else{		if (theform.prodno.checked==true){			if (flag==1){				theform.vent.name="prvent";				newwin=open("/loading.htm","shoplist","width=400 height=300");				theform.TASK_ALIAS.value="shopcart";				theform.target="shoplist";				newwin.focus();							}else if (flag==2){				theform.TASK_ALIAS.value="collect";				theform.prodno.name="colprodno";			}			theform.submit();		}else{			if (flag==1){				alert('请选择要购买的书籍!');			}else{				alert('请选择要收藏的书籍!');			}		}	}}theform.TASK_ALIAS.value=alias;theform.target="_self";}function imgchange(){setTimeout("imgchange1();",10000);}function imgchange1(n){ if (n==null) n="coverImg";for(var i=1;i<=khGetElementsCountByName(n);i++){  if(khGetElementsByName(n,i).readyState=="uninitialized") khGetElementsByName(n,i).src="/images/jpg/no.jpg";}}

⌨️ 快捷键说明

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