title: Wordpress root URL with Javascript
body: <p>I am using this script on my Wordpress website: <a href="http://www.robwalshonline.com/posts/jquery-plugin-random-image-on-page-load/" rel="nofollow noreferrer">JQuery Plugin: Random Image</a></p>
  
  <p>The problem I have is that I don't know what sort of code to put in the path section so that Wordpress would be able to fetch the images from the images folder. /images is not enough, since it'll just give me www.mydomain.com/images/image.jpg, and obviously that is not the whole URL when using Wordpress.</p>
  
  <p>I tried this: <a href="https://stackoverflow.com/questions/5221630/wordpress-path-url-in-js-script-file">wordpress path url in js script file</a></p>
  
  <p>I can't get it to work however. Whenever I place </p>
  
  <pre><code>var templateUrl = '&lt;?= get_bloginfo("template_url"); ?&gt;';
  </code></pre>
  
  <p>in my file, I just get an error</p>
  
  <pre><code>%3C?=%20get_bloginfo(%22template_url%22);%20?%3E/images/image.jpg
  </code></pre>
  
  <p>What am I doing wrong?</p>