title: Call href from JavaScript
body: <p>This is the same question as <a href="https://stackoverflow.com/questions/1782556/calling-href-from-javascript">THIS ONE</a>, I can't answer that anymore, so I'm re-posting it with my account.<br>
  Sorry for the mess.</p>
  
  <p>I need a Greasemonkey script that on a page load activates a href link like 'javascript:FUNCTION'.
  I've seen this code:</p>
  
  <pre><code>&lt;script language="Javascript" type="text/javascript"&gt;
      function somescript() {
              window.location.href = document.getElementById('ololo').href;
      }
  &lt;/script&gt;
  
  &lt;a href="javascript:alert('test');" id="ololo"&gt;test&lt;/a&gt;
  &lt;br /&gt;
  
  &lt;a href="javascript:somescript()"&gt;click me&lt;/a&gt;
  </code></pre>
  
  <p>and, while it works on a local page even when using onload, it doesn't work when I use it in my script.</p>
  
  <p>Probably I'm missing something when transferring the code from the body of an html page to a Greasemonkey script.</p>
  
  <p>I hope this time the question is more clear, excuse me for any misunderstanding, but I'm still a beginner with JS.</p>