I'm using drupal_add_js for some inline jQuery - I need to parse some php variables in the inline jQuery, what is the correct way to do it?
drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });',
array('type' => 'inline', 'scope' => 'footer', 'weight' => 5)
);
I've tried this, and it DOES print the variable, but breaks the JS code in the process (splits the jquery code up and doesnt function) :
drupal_add_js('jQuery(document).ready(function () { alert(" '. print $site_name .' "); });',
array('type' => 'inline', 'scope' => 'footer', 'weight' => 5)
);