String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
多边形导航特效
点击按钮获取您当前坐标(可能需要比较长的时间获取):
<script><br />var x=document.getElementById("demo");<br />function getLocation()<br /> {<br /> if (navigator.geolocation)<br /> {<br /> navigator.geolocation.getCurrentPosition(showPosition);<br /> }<br /> else{x.innerHTML="该浏览器不支持获取地理位置。";}<br /> }<br />function showPosition(position)<br /> {<br /> x.innerHTML="纬度: " + position.coords.latitude + <br /> "<br>经度: " + position.coords.longitude; <br /> } <p></script>
结果: