更改URL,而不使用JavaScript重定向 [英] change url without redirecting using javascript

查看:244
本文介绍了更改URL,而不使用JavaScript重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何改变URL重定向没有像本网站 http://dekho.com.pk /广告功能于拉合尔 当我们在选项卡单击该URL的变化,但在网页dosent重新加载完全。还有计算器上的其他问题,表明这是不可能的,但我想知道如何在上面提到的网站已经实现它。 谢谢

I would like to know how to change the url without redirecting like on this website http://dekho.com.pk/ads-in-lahore when we click on tabs the url changes but the page dosent reload completely. There are other questions on stackoverflow indicating that it is not possible but i would like to know how the above mentioned website have implemented it. Thanks

推荐答案

使用 pushState

window.history.pushState("", "", '/newpage');

这篇关于更改URL,而不使用JavaScript重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆