employee.js

来自「人力资源管理系统」· JavaScript 代码 · 共 50 行

JS
50
字号
function getEmployeeNames(){

		$.ajax({
			type: 'GET',
		    url: 'FileAction.do?method=getEmployeeNames&time='+new Date().getTime(),
		    date: '',
		    timeout: 5000,
		    error: function(){
		        alert('请求员工数据出错,请稍候刷新页面!');
		    },
		    success: function(msg){
		    	
		    	if(msg=="0"){
		    		alert("暂时没有员工!");
		    	}else{
			        //alert(msg);
			        var item=msg.split("$$$$");
					//var content=null;
						
						//var oSelect=document.getElementById("DBnewsTypes");
					var oOption = null;//document.createElement("OPTION"); 
		
					var i=0;
					for(;i<item.length;i++){
							//alert(item[i]);
						//content=item[i].split("^^^^");
						oOption="<option value='"+item[i]+"'>"+item[i]+"</option>";
						//alert(oOption);
						$(oOption).appendTo("#emp_name");
					}
		    	}
		    }
		});

}


function nameNotNull(){
	$("font").empty();
		//员工名字不能为空
		if($("select")[0].value=="0"){
			$("select[@name=emp_name]").after("<font color=red>请选择一个员工</font>");
			$("select[@name=emp_name]").focus();
			return false;		
		}
		
		return true;

}

⌨️ 快捷键说明

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