javascript - Can onclick take a function in a function? -


this want.

onclick="pager(function2();)

but doesn't seem work.

take out semicolon:

onclick="pager(function2())" 

http://jsfiddle.net/bqyvv/

you not passing function function, value. when element clicked, function2() called, , it's return value becomes argument pager() function. if function2 not return anything, pager receive undefined argument.


Comments

Popular posts from this blog

php - How to build a web site which gives a sub-domain dynamically to every registered user? -

Delphi Wmi Query on a Remote Machine -