【发布时间】:2022-12-28 00:29:04
【问题描述】:
Look at the example of the online store. https://online-store-rs.netlify.app/ When you click to button "smartphones", "Apple", or place ranges, window location paths changes to https://online-store-rs.netlify.app/?category=smartphones&brand=apple&price=90%E2%86%95899 How is it done? When in javascript I change window.location.path to something, page redirecting. How can I change only path without that redirecting?
【问题讨论】:
-
you might be referring to
location.history- specifically history.pushState? That allows you to change the displayed URL ( address bar ) without reloading the page.
标签: javascript html