title: Replace text on webpage using javascript
body: <p>I am trying to replace some text on my sites page using javascript. I must use javascript because the replacement is dependent on the site resolution. However I found that the code bellow doesn't work. Why is it? Does similar things work on iphone (these javascript functions)? Thanks.</p>
  
  <pre><code>&lt;SCRIPT language="JavaScript"&gt;
  &lt;!--
  if ((screen.width&lt;=500))
  {
     document.body.innerHTML = document.body.innerHTML.replace('text to replace', 'replacement');
  }
  //--&gt;
  &lt;/SCRIPT&gt;
  </code></pre>