javascript function display in body
<p>I've got this location script:</p>

<pre><code>&lt;html&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;/head&gt;

&lt;body&gt;
 &lt;p id="demo"&gt;&amp;nbsp;&lt;/p&gt;
&lt;script&gt;
var x=document.getElementById("demo");
function getLocation()
  {
  if (navigator.geolocation)
    {
    navigator.geolocation.getCurrentPosition(showPosition);
    }
  else{x.innerHTML="Geolocation is not supported by this browser.";}
  }
function showPosition(position)
  {
   x.innerHTML="Latitude: " + position.coords.latitude + 
  "&lt;br&gt;Longitude: " + position.coords.longitude;    
  }

window.onload = getLocation();

&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>and it works perfect but what I want to do is to display the coordinaes in my body one more time without copy the same script. I just want something like php code echo $coords for example?</p>
