我正在尝试在这里为 iPhone 开发一个基于 Web 的应用程序。一切正常(在浏览器中测试)但是,当我接受这个时:
function goToLocation() {
latitude = document.getElementById("<%=txtLatitude.ClientID%>").innerHTML;
longitude = document.getElementById("<%=txtLongitude.ClientID%>").innerHTML;
window.parent.location = 'http://maps.google.com/maps?q='latitude + ',' +
longitude + '&z=14';
}
与我的 aspx 混合:
<tr><td>Latitude: </td>
<td><asp:Label ID="txtLatitude" runat="server"></asp:Label></td>
</tr>
<tr><td>Longitude: </td>
<td><asp:Label ID="txtLongitude" runat="server"></asp:Label></td>
</tr>
我得到:
http://maps.google.com/maps?q=<a href="tel:11.111">11.111</a>,<a href="tel:22.222">22.222</a>
其中 11.111 是我的纬度,22.222 是我的经度。
当我使用计算机浏览器时,它会显示为 http://maps.google.com/maps?q=11.111,22.222
所以,我想我的问题是:有没有办法告诉iphone不要在前面加上“tel:”,或者,我想我可以通过告诉javascript从一个数字开始来解决这个问题(我可以自己查找)。但同时,我不喜欢将经纬度作为手机中的链接。
谢谢!