How to transfer webform submission ID to client side
You could start by putting the submission id into $_SESSION and add it to Drupal's js settings

drupal_add_js(array('mymodule' =&gt; array('webform_id' =&gt; $_SESSION['webform_id'])), 'setting');


Then access it on the client side

webform_id = Drupal.settings.mymodule.webform_id