当前位置: 民宿 > 民宿新闻

住宿价格查询

2024-09-23 02:08分类: 民宿新闻 阅读:

 

请提供以下信息以查询住宿价格:






<script> document.querySelector('form').addEventListener('submit', (event) => {event.preventDefault();const destination = document.querySelector('destination').value;const checkIn = document.querySelector('check-in').value;const checkOut = document.querySelector('check-out').value;const numAdults = document.querySelector('num-adults').value;const numChildren = document.querySelector('num-children').value;const query = `destination=${destination}&checkIn=${checkIn}&checkOut=${checkOut}&numAdults=${numAdults}&numChildren=${numChildren}`;fetch(`https://example.com/api/hotel-prices?${query}`).then(response => response.json()).then(data => {const results = document.querySelector('results');results.innerHTML = '';data.hotels.forEach(hotel => {const div = document.createElement('div');div.innerHTML = `

${hotel.name}

  • 价格:${hotel.price} 元
  • 地址:${hotel.address}
  • 评分:${hotel.rating}
`;results.appendChild(div);});}).catch(error => {console.error('Error fetching hotel prices:', error);alert('抱歉,无法获取酒店价格。请稍后再试。');});});


郑重声明:本文由:民宿新闻于(2024-09-23)发表了关于住宿价格查询的文章。如转载请注明出处!部分文章来源于网络,仅作为参考,如果网站中图片和文字侵犯了您的版权,请联系我们处理!

上一篇:民宿酒店多少钱一晚

下一篇:电竞酒店住一晚一般多少钱

附近酒店推荐

关注我们

    民宿酒店不一样的选择,更好的体验