Call javascript functions from each page

I would create a custom field containing the function to be called, for example called ‘function_to_call’.
In the templatefile add the code

$function_to_call = get_post_meta( get_the_ID(), 'function_to_call', true );
if ( $function_to_call != "" ) {
    echo '
          jQuery(document).ready(function($){
              ' . $function_to_call . '()
          });
    ';
}

Doing this only outputs the function if you set one in the Custom Fields. You could also make a list of available Functions to avoid Javascript errors.