title: How to write a dynamic text using javascript
body: <p>I am trying to accomplish something like this :</p>
  
  <pre><code>&lt;?php $url = 'http://www.mydomain.com/img/picture.jpg'; ?&gt;
  &lt;img src='&lt;?php echo $url ?&gt;' /&gt;
  </code></pre>
  
  <p>Only the problem is I want to accomplish this using javascript. Something like this</p>
  
  <pre><code>&lt;script&gt;url = 'http://www.mydomain.com/img/picture.jpg'&lt;/script&gt;
  &lt;img src='&lt;script&gt;document.write(url)&lt;/script&gt;' /&gt;
  </code></pre>
  
  <p>Of course it wouldn't work, but you got the idea. Any thought ?</p>