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

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -