Different Ways Of Using $.connect Function In JQuery
Posted by Ruth
9 Dec, 2011
The syntax of connect function is$.connect(sourceObj/*object*/, sourceFunc/*string*/, callObj/*object*/, callFunc/*string or Func*/)sourceObj(optional) is the object of the source function to which we want to connectsourceFunc is the function name to which we want to connectcallObj(optional) is the object which we want to use for the handler functioncallFunc is the function that we want to execute when sourceFunc is executed.Here sourceObj, callObj are optional for the global functions.suppose if your sourceFunc is global function then no need to pass the sourceObj or you can use null or selfsuppose if your callObj is global function then no need to pass the callObj or you can use null or selfex:// fun1, fun2 are global functions1. $.connect('fun1',fun2)2. $.connect(null,'fun1',fun2)3. $.connect(self,'fun1',fun2)4. $.connect('fun1',null,fun2)5. $.connect('fun1',self,fun2)6. $.connect(self,'fun1',null,fun2)
The syntax of connect function is$.connect(sourceObj/*object*/, sourceFunc/*string*/, callObj/*object*/, callFunc/*string or Func*/)sourceObj(optional) is the object of the source function to which we want to connectsourceFunc is the function name to which we want to connectcallObj(optional) is the object which we want to use for the handler functioncallFunc is the function that we want to execute when sourceFunc is executed.Here sourceObj, callObj are optional for the global functions.suppose if your sourceFunc is global function then no need to pass the sourceObj or you can use null or selfsuppose if your callObj is global function then no need to pass the callObj or you can use null or selfex:// fun1, fun2 are global functions1. $.connect('fun1',fun2)2. $.connect(null,'fun1',fun2)3. $.connect(self,'fun1',fun2)4. $.connect('fun1',null,fun2)5. $.connect('fun1',self,fun2)6. $.connect(self,'fun1',null,fun2)
Comments Received:
Please give your suggestions and feedback: