aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes jQuery newbie doubts Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "jQuery newbie doubts" Watch "jQuery newbie doubts" New topic
Author

jQuery newbie doubts

Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 137
Good day,

could anyone here please enlighten me what is "function ()" means from below ?



Thank you !
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56553
    
  14

It's a function literal, also known as an inline function or an anonymous function. It creates a new unnamed function.



[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56553
    
  14

By the way, there's a more commonly used shortcut for creating a ready handler, and that's to pass an inline function to the $ function:

Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 137
Thanks Bear ! another questions, how can i call the inner function "mytest" from input like button and other ?

Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

I'd recommend you take some time and do a little reading. Here, for example. This will answer a lot of these "jQuery 101" type questions. Bear's book is also a great read if you can pick it up.


Or better yet

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: jQuery newbie doubts
 
Similar Threads
Invoking functions in Javascript
main() function
call java code from javascript
Static passwords
Jquery function is not working