How to get the node ID in jQuery/JavaScript
As mentioned above, Drupal core has no use for the node ID on the client side so it doesn't pass it through. if you want access to it you'll need to add it manually:

function MYMODULE_node_view($node, $view_mode, $langcode) {
  if ($view_mode == 'full') {
    $setting = array('MYMODULE' =&gt; array('currentNid' =&gt; $node-&gt;nid));
    $node-&gt;content['#attached']['js'][] = array(
      'data' =&gt; $setting,
      'type' =&gt; 'setting',
    );
  }
} 


Then on the client side you'll have access to it through Drupal.settings:

var currentNid = Drupal.settings.MYMODULE.currentNid;