ITeye博客

JS

共 4 篇文章

IE 重载 iframe

迁移 http://aikin.me/2014/06/16/ie-iframe-cache/ 最近“致力于”调 IE9 、IE10 、 firefox 、 chrome 浏览器对 iframe刷新。 发现在IE浏览器中,有些刷新 iframe 的方法会加载缓存。以下就对一些方法在 IE9 、IE10(以下简称IE)的产生效果介绍一下: 1、对 iframe 的 src 属性重新赋值来实现刷新 $("#iframeId").attr("src", $("#iframeId").attr("src")); 在 IE 中,使用这个方法后 iframe 没有刷新的效果。iframe反应很平静。 2、…

2014-06-16 22:44 · JS · Ajax · IE · reload · iframe

cocos2d-html5 Sprite 注册点击事件

在 cocos2d-html5, 发现 Sprite 类没有点击事件,需要注册点击的代理, 才能接受点击事件。下面一段代码写了一个可以接受点击事件的 DemoSprite 类。 var DemoSprite = cc.Sprite.extend({ _touchBegan: false, _touchEnabled: true, ctor: function (image) { this._super(); this.init(image); }, onEnter: function () { cc.Director.getInstance().getTouchDispatcher()._a…

2014-06-16 17:55 · JS · click · touch · sprite

用hash表 来替换if else

在写处理短信的时候,要根据短信的内容来判断是报名短信和竞价短信时候,要到一些 if else, 可以用hash表的形式来替换掉这些代码。 if(message.content.substring(0, 2).toUpperCase() == "BM") { process_activity_sign_up_message() } else if (message.content.substring(0, 2).toUpperCase() == "JJ") { process_bid_sign_up_message() } else { prompt_message_format() } 下面…

2014-01-17 22:04 · JS · JS · hash

AngularJS 一般的 errors

1.处理 not find method 错误 有时候新建了一个js文件,调用js文件的function时 ,会提示function undfied ,这时就要记住gen一下。 2.在 haml 中用了一些class 但无法显示,或是提示一些 method not find,这时就得注意 index.haml 是否引入相应得 css 和 js 文件。

2014-01-16 09:26 · JS