what is the use of bind() in javascript??
And if you want to detach that same event in jQuery, you can use unbind.
Keith Rousseau
2010-02-10 12:48:54
Thats not entirely true. EcmaScript 5 adds a bind method.read more about it on John Resig's blog: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
hojberg
2010-02-10 13:29:52
+1
A:
binding is generally used to refer to attaching a function to an event (it could, but is unlikely to, mean linking a data presentation object to a data source)
Common example
when the mouse is moved over an element you want to run function "dosomething". People would refer to this as binding the dosomething function to the element's mousemove event
the concept of (event) binding is implemented in a number of javascript frameworks such as jQuery or Prototype
So the meaning will vary depending on the context of the code you are looking at.
PeanutPower
2010-02-10 12:40:08
+1
A:
Dojo has a library, IO.bind where you can do magic using the bind(); method to attach HTML elements with certain level of data binding.
http://dojotoolkit.org | demo's will guide you with more detailed idea.
T.Raghavendra
2010-02-10 13:24:28