Get node path via javascript
You can add the node ID manually to Drupal settings with drupal_add_js(), for example from a preprocess function.

// PHP
$setting = array('setting_1' =&gt; 'value_1', 'setting_2' =&gt; 'value_2');
drupal_add_js($setting, 'setting');




// JavaScript
var nodeId = Drupal.settings.setting_1;