添加一个cs文件,在里面定义回调 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Runtime.InteropServices; namespace GotecomBigDipper { [ Serializable ] [ ComVisible (true )] public delegate void RS_DATA
上一节讲异步原理的时候基本上把回掉函数也捎带讲了一些,这节主要举几个例子来具体化一下.在开始之前,首先要明白一件事,在javascript里函数可以作为参数进行传递,这里涉及到高阶函数的概念,大家可以自行google一下. 传统的同步函数需要返回一个结果的话都是通过return语句实现,例如: function foo() { var a = 3, b = 2; return a+b; } var c = foo(); console.log(c); 就是说后面的代码console.