How to call javascript function (jquery) in a shortcode?

Use wp_enqueue_script() with $in_footer parameter set to true, when loading scripts with your shortcode. To pass data from the PHP part of your code to the JS part use wp_localize_script().

wp_enqueue_script( 'script_name', '/script-location/script.js', array(), '1.0.0', true );  
$data_array = array(
  'key_1' => 'val_1',
  'key_2' => 'val_2'
);
wp_localize_script( 'script_name', 'data_object_name', $data_array );

You now can access the data in your script by addressing the data object – for example:

console.log( data_object_name.key_1 );