我有一个使用HTML5地理位置服务的网络应用程序,除了我使用jasonette在android上推出它之外,它工作得很好。这有可能做到吗?
这是我的load.jason -
{
"$jason": {
"head": {
"title": "Web Container Agent"
},
"body": {
"background": {
"type": "html",
"url": "https:mysite.com",
"id": "app",
"action": {
"type": "$default"
}
}
}
}}
这是我的主索引页面。现在我有一个名为location.php的文件,出于这个目的,我将使用来自w3的演示-
<script>
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 +
"<br>Longitude: " + position.coords.longitude;
}
</script>我是否需要为location.php添加第二个json文件?或者在当前的json文件中编写一个辅助脚本来实现这一点?或者这是不可能的?
谢谢!
发布于 2018-03-29 02:17:36
嘿,这是可能的,但我猜是HTTPS的错误,你可能会尝试在你的本地服务器上得到这个脚本,这个脚本将只在" https“域上工作,你不需要在这个上传递任何东西,只需确保你有https域。
https://stackoverflow.com/questions/49541416
复制相似问题