Getting Started with ASP.NET MVC - Part 5: How to do programming with razor syntax
First Time? You can support us by signing up. It takes only 5 seconds. Click here to sign up. If you already have an account, click here to login.


Upload Image Close it
Select File

Browse by Tags · View All
BRH 48
#DOTNET 34
#ASP.NET 29
jQuery 22
ASP.NET 20
.NET 20
WPF 9
jquery interview questions 9
jquery faq 8
ASP.NET4 8

Archive · View All
February 2011 10
September 2011 4
August 2011 4
July 2011 4
May 2011 4
April 2011 4
March 2011 4
October 2011 4
June 2011 4
January 2011 4

What is jQuery Connect ? How to use jQuery Connect?

Mar 7 2011 5:05AM by Hima   

This is a jQuery plugin that is used to connect / bind a function to another function. It is more of assigning a handler for another function. Connect is used to execute a function whenever a function from another object or plugin is executed. We can connect to an event of a DOM element too using this function. In the sense same connect function can be used for both DOM elements and for the functions.

 
$.connect(refobj,refFuncName, connObj,connFunc); 

This means that, when the reference function is executed, the connected function gets executed automatically after it. To understand more please analyze the following example

 
function A(){ 
this.fun1 = function(){ 
       called1 = 'calssA-fun1'; 
      } 
} 
     var a = new A(); 
  function B(){ 
     this.fun2 = function(){ 
     called2 = 'classB-fun1'; 
     } 
  } 
     var b = new B(); 
     $.connect(a,'fun1',b,fun2); 

Here we connected "fun2" of object b to "fun1" of object a. When we call b.fun2, a.fun1 will also execute automatically.

This is very handy to execute some function when some other function is executed from the plug-in . In order to play with it follow these steps.

  • Download jquery.connect.js file.
  • Include this file in your html file.
  • Take help of $.connect function as illustrated to connect a function to another function.

Tags: BRH, .NET, #DOTNET, #ASP.NET, ASP.NET, jQuery, jquery interview questions., jquery faq, jquery interview questions, jqueryfaq, jQueryinterview questions, how to use jquery connect, jquery connect,


Hima
26 · 7% · 1504
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Beyondrelational.com Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising