Help Needed In Javascript

I am a total to programming newbie. Including php, html and javascript I have part of a program for retrieve the current location via javascript…using geolocation…

var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
} else { 
x.innerHTML = "Geolocation is not supported by this browser.";
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude + 
"<br>Longitude: " + position.coords.longitude;

My problem is i need to get the current location’s Longtitude & Latitude information to generate a new web page link & load that new page … All this to be in javascript.

Example :
This new page is working perfectly… no problem.

Any Help Is Very Much Appreciated… Thank You In Advance From A Very Newbie…

Hello there.

I am not sure if this is what you are looking for:

Hope this helps.

Hi… Thanks for the suggestion… but I am looking for more information… I want to modify the function Show Position…
I need To retrieve the longtitude , latitude info merged and generate example
new.php?w1=2.9272622,101.73036820000002 where the
2.9272622,101.73036820000002 is from the merged longtitude , latitude
then it need to load new web page new.php?w1=2.9272622,101.73036820000002

Would Very Much Appreciate any help… Thank You