www.gusucode.com > 软件公司网站源码程序 > 软件公司网站源码程序/tools/admin/js/mark_type.js
//获取浏览器类型 function GetBrowser() { var browser = ''; var agentInfo = navigator.userAgent.toLowerCase(); if (agentInfo.indexOf("msie") > -1) { var re = new RegExp("msie\\s?([\\d\\.]+)","ig"); var arr = re.exec(agentInfo); if (parseInt(RegExp.$1) >= 5.5) { browser = 'IE'; } } else if (agentInfo.indexOf("firefox") > -1) { browser = 'FF'; } else if (agentInfo.indexOf("netscape") > -1) { var temp1 = agentInfo.split(' '); var temp2 = temp1[temp1.length-1].split('/'); if (parseInt(temp2[1]) >= 7) { browser = 'NS'; } } else if (agentInfo.indexOf("gecko") > -1) { browser = 'ML'; } else if (agentInfo.indexOf("opera") > -1) { var temp1 = agentInfo.split(' '); var temp2 = temp1[0].split('/'); if (parseInt(temp2[1]) >= 9) { browser = 'OPERA'; } } return browser; } //城市地区分类表单 function zoneCheckform(theform){ if(theform.zone.value.length < 1 || theform.zone.value=='请填写地区名称'){ alert("请填写地区名称"); theform.zone.focus(); return false; } return true; } //弹出对话框 function Dpop(url,w,h){ res = showModalDialog(url, null, 'dialogWidth: '+w+'px; dialogHeight: '+h+'px; center: yes; resizable: no; scroll: no; status: no;'); if(res=="ok"){window.location.reload();} } $(document).ready(function(){ $('#typeadd').submit(function(){ var title=$("#title")[0].value; var catpath=$("#catpath")[0].value; $.ajax({ type: "POST", url:"post.php", data: "act=typeadd&title="+title+"&catpath="+catpath, success: function(msg){ if(msg!='OK') alert(msg); } }); }); }); $(document).ready(function(){ $('.typemodify').submit(function(){ var id=this.id; id=id.substr(11); var modifytitle='#modifytitle_'+id; modifytitle=$(modifytitle)[0].value; $.ajax({ type: "POST", url:"post.php", data: "act=typemodify&modifyid="+id+"&modifytitle="+modifytitle, success: function(msg){ if(msg!='OK') alert(msg); } }); return false; }); }); $(document).ready(function(){ $('.typedel').submit(function(){ var id=this.id; id=id.substr(8); $.ajax({ type: "POST", url:"post.php", data: "act=typedel&delid="+id, success: function(msg){ if(msg!='OK') alert(msg); } }); }); });