随笔分类 -  JavaScript

javascript知识库
摘要:在实际开发中往往会遇到检查表单数据的合法性,如果数据不合法,就不让其提交。先看以下简单的代码。<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><script language="javascript">//--->function checksubmit(){ if (document.form1.myname.value=="") { alert("请输入开始数值!"); 阅读全文
posted @ 2012-12-13 15:00 KoMiles 阅读(42781) 评论(1) 推荐(4)
摘要:先看一段代码:for(var j=0;j<24;j++){ (jQuery).getJSON('log_analyze.php',{r:Math.random(),logid:logid,op:2,j:j},function(data){ if(data.success_agent){ var width=j*10; $("#up_time_loading").empty().append("<div style=\"width:"+width+"px;height:10px;border:1px soli 阅读全文
posted @ 2012-11-19 17:43 KoMiles 阅读(67735) 评论(0) 推荐(1)
摘要:按下回车时触发事件:第一种:当键盘按下回车时触发这个不带参数的函数<meta http-equiv="content-type" content="text/html; charset=gb2312"/><script type="text/javascript"> function show () { var e=window.event||arguments.callee.caller.arguments[0]; if(e.keyCode==13){ alert("你按下了回车"); } 阅读全文
posted @ 2012-10-23 16:41 KoMiles 阅读(8165) 评论(7) 推荐(1)