惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - mill2002

当在ECLIPSE中import现存项目时,如遇到版本不符 运行sicp一书5.5.7节“编译代码与求值器的互连”的方法 MIT Scheme 的基本使用 李先静先生一书第11章jdbshell试用小结 ehua的blog 在microsoft vc++ 2008版中运行李先静先生一书及数据结构高一凡先生一书实例的方法 在android模拟机上安装APK应用程序的方法 treepad compiler design 的资料 编译器前端的Windows版命令行测试方法 cloud Try Filecatchered example-rss10.xml (系统找不到指定的文件。) ANT 和 JDK 的设置 - mill2002 书‘Rss & Atom in Action’Ch05 中CSHARP示例 vi简单操作说明 - mill2002 - 博客园 编译器gcc的使用 Javascript中的this - mill2002 - 博客园 fuhao.co.uk网页更新方法之一:
学习回调函数的笔记
mill2002 · 2012-06-07 · via 博客园 - mill2002

将不同的回调函数传给某一函数,该函数将相应实现不同的功能,这样该函数自身保持不变,可
提高复用,同时可以完成多种任务,达到定义与实现的解耦。

状态模式与回调函数的结合使用,可以使逻辑分支简单清晰,功能多样。详见李先静的书
《程序员成长计划》第十章。

回调函数实际就是一个指向函数的指针,作为函数的参数,当需要时,写出来(也就是调用)就可实现

相应作用,其中回调函数带有上下文参数,用于存储、或其他作用(如扩展)。

用户界面与实现函数(内部实现)通过回调函数(或接口)使内部实现反向调用用户界面,
见李先静老师的书第11章。

JS中回调函数的使用:
AjaxInAction中第10章“输入前提示”中
var loader1 = new net.ContentLoader
(theTextBox.obj.erverLoader,BuildChoices,null,"Post",strParams);
其中BuildChoices就是回调函数,当创建net.Contentloader时,BuildChoices就被调用。

现在看的书(ebook)
android.开发书籍.Pro.Android.Web.Apps.Develop.for.Android.using.HTML5,.CSS3.&.JavaScript
中第4章todolist.js有callback的调用,当时的感觉是,该函数与本地数据库操作有关,是builtin的

吗?答案:错!
getMostImportantTask: function(callback){
中的callback是形参,实际参数是调用getMostImportantTask时传递过来的起处理作用的函数。
todolist.js中后半段:
activeMain : function(){
 ToDoList.Storage.getMostImportantTask(function(task)){
  if(task){
其中传给getMostImportantTask的匿名函数就是前面形参callback所对应的实参。

在activateMain中给出了在getMostImportantTask使用的callback的实现,即
function(task){
 if(task){
   jQuery("#main .notasks").remove();

在卢春城的Lesktop中大量使用的callback应该也是这样的作用。待总结。