How to access global variable from within Drupal content I am trying to access a global variable I created using javascript within a content node i created. In an attached js file i have var rootpath = "/clients/UMP/"; 

Inside of my drupal page i have:

&lt;script&gt;document.write(window.rootpath);&lt;/script&gt;


But it just shows the text: undefined

Am i doing something wrong? Is there a more better way to do it using php perhaps?
Thank you for taking the time to read this and respond. I apologize for being such a noob with drupal. I have only been using it for a few weeks.
Based on your comments, you might want to try using Drupals built in functions to retrieve the correct path for your assets.

The 2 you could take a look at are base_path() and path_to_theme().

For example:

&lt;img src="&lt;?php print base_path(); print path_to_theme()?&gt;/images/image1.jpg" /&gt;