Last updated September 1, 2011. Created by mr.baileys on March 12, 2007.
Edited by batigolix, gagarine, Kasper Souren, aj045. Log in to edit this page.
Passing PHP variables to JavaScript is explained in the The Drupal JavaScript API
Last updated September 1, 2011. Created by mr.baileys on March 12, 2007.
Edited by batigolix, gagarine, Kasper Souren, aj045. Log in to edit this page.
Passing PHP variables to JavaScript is explained in the The Drupal JavaScript API
Comments
There is a simpler method
There is a simpler method that is described here: http://wtanaka.com/node/7813.
use "setting" as second variable.
Rougthly, your variables will be available in this array: Drupal.settings
API is here: http://api.drupal.org/api/function/_drupal_add_js/5 (_drupal_add_js is called by drupal_add_js)
--
mag{nus,oo}
http://magooweb.com/
http://magnus.anderssen.ch/
--
mag{nus,oo}
http://magnus.anderssen.ch/