Pass a PHP function to javascript

Pass a PHP function to javascript