随笔分类 -  javascript

摘要:在javascript函数中使用return true是可以返回true的,但是如果avascript函数中使用了ajax方式发送异步请求函数的话,return true 就不会返回true,而是返回的undefined。网上查了一下原因是因为是异步方法的原因。我的解决办法是在异步方法中定义一个变量... 阅读全文
posted @ 2013-11-09 23:27 Handy~~💪 阅读(674) 评论(0) 推荐(0)
摘要:一、采用正则表达式实现startWith、endWith效果函数String.prototype.startWith=function(str){ var reg=new RegExp("^"+str); return reg.test(this);}//测试ok,直接使用str.endWith("... 阅读全文
posted @ 2013-11-09 23:18 Handy~~💪 阅读(312) 评论(0) 推荐(0)
摘要:1、首先导入jquery的js文件2、在脚本function中添加以下代码:$.ajax( { cache : false, // (默认: true) jQuery 1.2 新功能,设置为 false 将不会从浏览器缓存中加载请求信息 ifModified : true, //(默认: false... 阅读全文
posted @ 2013-04-07 18:29 Handy~~💪 阅读(151) 评论(0) 推荐(0)