Posted By

JohnnyGamba on 01/28/11


Tagged

drupal


Versions (?)

Get any Drupal data in javascript


 / Published in: PHP
 

  1. # In any hook_init().
  2. drupal_add_js(array( 'citris' => array( 'basePath' => base_path(), ), ), 'setting');
  3.  
  4. #In any js inside Drupal
  5. uri = Drupal.settings.citris.basePath + "mypath";

Report this snippet  

You need to login to post a comment.