I was learning j-query with some video courses, in that i found they were using $.apply , looks latest version of j-query had abandoned it. Is there any alternative for it in the latest version 2.1.0 ?
Asked
Active
Viewed 136 times
0
-
2`$.apply` is not provided by jQuery. It's a property of all functions. – Blender Mar 02 '14 at 10:28
-
See documentation for `.apply()` on all functions here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply – jfriend00 Mar 02 '14 at 10:29
-
As you've heard that the apply function isn't part of jQuery, This seems like a case of the [XY Problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). Maybe if you'd provide where you need to use it in your code, you could get a specific alternative. – TastySpaceApple Mar 02 '14 at 10:34
1 Answers
0
What's the .apply jQuery function?
It's not a jQuery function. Any function in javascript has an .apply()
method. And the $ or jQuery
object is no different.
It's used to change the scope (http://api.jquery.com/Types/#Context.2C_Call_and_Apply), but I don't see any reason to use it.
Depending on your code, you might be looking for the $.proxy()
..?

Community
- 1
- 1

TastySpaceApple
- 3,115
- 1
- 18
- 27