摘要: html5 drag api详解,利用html5 drag实现拖拽。并可以用setData/getData实现数据传递。 阅读全文
posted @ 2013-08-25 02:11 城池 阅读(7474) 评论(0) 推荐(0) 编辑
摘要: 在开发中,我们常常碰到需要定时拉取网站数据,如:setInterval(function(){ $.ajax({ url: 'xx', success: function( response ){ // do something with the response } });}, 5000);请思考下此写法有什么弊端?能想到情况是:如果接口异常了,程序仍然会间隔5000ms抓取数据。换句话说,我们不能捕获到异常,并做一些合理的调整。所以我们换个写法:// new hotness(function loopsiloop(){ ... 阅读全文
posted @ 2013-08-25 01:26 城池 阅读(4337) 评论(0) 推荐(0) 编辑