gpt4 book ai didi

javascript - PhoneGap 无法调用未定义的方法 loadurl

转载 作者:行者123 更新时间:2023-12-04 16:46:22 26 4
gpt4 key购买 nike

我写了一个方法来从用户那里获取地址信息,然后将其显示在谷歌的 map 上。这是我写的方法

function doRemoteMapEmployee(e) {
var mapEmployeeAddressLine1 = (EmployeeInfo.at(0).EmployeeAddressLine1 !== null) ? EmployeeInfo.at(0).EmployeeAddressLine1 + ', ' : '',
mapEmployeeAddressLine2 = (EmployeeInfo.at(0).EmployeeAddressLine2 !== null) ? EmployeeInfo.at(0).EmployeeAddressLine2 + ', ' : '',
mapEmployeeAddressLine3 = (EmployeeInfo.at(0).EmployeeAddressLine3 !== null) ? EmployeeInfo.at(0).EmployeeAddressLine3 + ', ' : '',
mapEmployeeAddressCityTown = (EmployeeInfo.at(0).EmployeeAddressCityTown !== null) ? EmployeeInfo.at(0).EmployeeAddressCityTown + ', ' : '',
mapEmployeeAddressZipPostCode = (EmployeeInfo.at(0).EmployeeAddressZipPostCode !== null) ? EmployeeInfo.at(0).EmployeeAddressZipPostCode : '',
address = mapEmployeeAddressLine1 + mapEmployeeAddressLine2 + mapEmployeeAddressLine3 + mapEmployeeAddressCityTown + mapEmployeeAddressZipPostCode;
navigator.app.loadUrl("http://maps.google.co.uk/?q=" + address);
}

当我运行它时,它会给我错误无法调用未定义的方法 loadurl。现在,如果我只是用实际地址替换地址,它会给我同样的错误。知道这里可能出了什么问题吗?

最佳答案

试试用这个代替:

window.open("http://maps.google.co.uk/?q=" + address, "_system");

关于javascript - PhoneGap 无法调用未定义的方法 loadurl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12279374/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com