{cod; cod; quod; quod; quod''smessage; quot; quot; quot; quot;
这是我的代码。每当我尝试检查链接时,它最终都会返回错误消息。我该怎么办来解决这个问题?
window.addEventListener('load', ()=>{
let lon;
let lat;
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(position => {
lon = position.coords.longitude;
lat = position.coords.latitude;
const api = `https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid=432199bc4e2df182e56f173156ed4922
`;
});
}else{
h1.textContent = "NOT WORKING"
}
});
This is my code. Whenever I try to check the link, it ends up returning an error message. What can I do to fix this?
window.addEventListener('load', ()=>{
let lon;
let lat;
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(position => {
lon = position.coords.longitude;
lat = position.coords.latitude;
const api = `https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid=432199bc4e2df182e56f173156ed4922
`;
});
}else{
h1.textContent = "NOT WORKING"
}
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论