摘要: 转自:http://www.jb51.net/article/75717.htm 阅读全文
posted @ 2017-09-27 16:29 AlanLeung 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 是变量名和函数名相同导致的 比如: function a(){} var a = a(); 阅读全文
posted @ 2017-09-27 16:24 AlanLeung 阅读(744) 评论(0) 推荐(0) 编辑
摘要: html的js或者css超过30行时,应当将js或css分离到外部文件,然后引入到html文件。 阅读全文
posted @ 2017-09-27 16:13 AlanLeung 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 对小数进行处理: 1.直接取整,舍弃小数,保留整数:intval(); intval(3.64159); // 3 2.四舍五入取整:round(); round(3.14159); // 3 round(3.64159); // 43.向上取整,有小数就加1:ceil(); ceil(3.1415 阅读全文
posted @ 2017-08-23 10:43 AlanLeung 阅读(6515) 评论(0) 推荐(0) 编辑
摘要: 先上代码(php): $id_card=""; $sql = "select * from people where id_card=".$id_card; 看似有值,但是这个sql是这样的: select * from people where id_card= 当然会语法错误。 这时候要把$id 阅读全文
posted @ 2017-08-22 15:44 AlanLeung 阅读(825) 评论(0) 推荐(0) 编辑
摘要: find方法返回的是一行记录,结果是一个数组,数组的key和sql中的field相对应,假设: $res=$model->find(filed="a,b,c"); 获取结果中的a的值用: $res["a"] 阅读全文
posted @ 2017-08-22 15:38 AlanLeung 阅读(4001) 评论(0) 推荐(0) 编辑
摘要: 原因是没有连接数据库。加上下面代码: $link = mysql_connect(DB_HOST,DB_USER,DB_PWD);mysql_select_db(DB_NAME) or die('Could not select database'); 业务全部完毕后记得手动关闭连接: <?php 阅读全文
posted @ 2017-08-22 15:34 AlanLeung 阅读(1223) 评论(0) 推荐(0) 编辑
摘要: 先上代码 讨论的是async这个条件,一般情况下都是false表示同步,但是遇到要加载的信息量非常多的时候,例如加载产品信息列表,一般会加载产品图片,这时候为了用户体验,可以先加载产品的其他信息,等其它信息加载完毕后,在发起ajax请求设置async=true,异步加载产品图片。 阅读全文
posted @ 2017-08-22 15:30 AlanLeung 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 1.JQuery控制radio选中和不选中 通过name $("input:radio[name="analyfsftype"]").eq(0).attr("checked",'checked');$("input:radio[name="analyshowtype"]").attr("checke 阅读全文
posted @ 2017-08-22 15:15 AlanLeung 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 因为笔者要重装系统,所以用到了光盘,光驱好久没用了,放进去竟然读不出来。 解决办法:把光驱上的尘清理干净,就能用了。 阅读全文
posted @ 2017-06-02 16:09 AlanLeung 阅读(247) 评论(0) 推荐(0) 编辑