浏览 1661 次
|
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
|---|---|
| 作者 | 正文 |
|
最后更新时间:2007-08-30 关键字: ajax javascript cache
http://www.monsur.com/projects/jscache/
这个js cache不错。 功能也比较全。在项目中用它来缓存些大计算量的javascript json 对象。
Cache cache = new Cache(200);
function reloadTagCloud() {
if (startDate != null && endDate != null) {
showIndicator();
var result = null;
if (tagSource == "Directory"){
result = cache.getItem("Directory" + startDate + endDate);
}
if (result != null){
processTagResult(result);
hideIndicator();
return ;
}
jsonrpc.subscribe.getTags(getTagsCallback, startDate, endDate, tagSource, 'frequency' /*tagOrder, should sort the top 20 locally, always use frequency on server side.*/);
}
}
function getTagsCallback(result, exception) {
if (exception) {
showError("An error has occurred: " + exception.message);
} else {
if (tagSource == "Directory"){
cache.setItem("Directory" + startDate + endDate, result);
}
processTagResult(result);
}
hideIndicator();
}
function processTagResult(result){
tagCloud.viewTags = result.sort(sortByFrquency);
tagCloud.setTagFontSizes();
updatTagCloudViewByOrder();
try {
dojo.byId("tagsButton").focus();
} catch (e) {}
}
声明:JavaEye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
|
|
| 返回顶楼 | |
|
最后更新时间:2007-08-30
Cache...这令我想起当年Cyrix 486DLC中那1kb的回写式缓存是多么的宝贵啊....
|
|
| 返回顶楼 | |
|
最后更新时间:2007-08-31
sp42 写道 Cache...这令我想起当年Cyrix 486DLC中那1kb的回写式缓存是多么的宝贵啊....
你那当年是什么年代。 我是没有经历过寸土寸斤的年代。 羡慕。 |
|
| 返回顶楼 | |
|
最后更新时间:2007-09-01
往事如烟了 呵呵
只是当年的激情。。不知现在算不算在延续着... 借javaeye这一宝地...抒心中之一幕...见谅了 |
|
| 返回顶楼 | |
|
最后更新时间:2007-12-26
good
carrot your colleague |
|
| 返回顶楼 | |
|
最后更新时间:2007-12-26
这个cache什么东西,是不是就是对象数组还是个什么,没听说过
|
|
| 返回顶楼 | |
|
最后更新时间:2007-12-27
carrot 写道 good
carrot your colleague 萝卜 你的处女贴献给了我呀。 |
|
| 返回顶楼 | |







