如何使用Javascript和JQuery操纵URL? [英] How to manipulate the URL with Javascript and JQuery?

查看:70
本文介绍了如何使用Javascript和JQuery操纵URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个包含许多Javascript交互的页面.但是,当用户浏览页面时,URL也必须更改.因此,当用户共享URL或将其保存时,它可以将其引导到其实际状态.

I want to make a page with a lot of Javascript interactions. However, while a user navigates through the page the URL must change too. So, when the user shares the URL or saves it, it can lead him to the actual state he was.

我该怎么做?

示例:

myapp.com/page1

myapp.com/page2

推荐答案

pushState ,如 github

这篇关于如何使用Javascript和JQuery操纵URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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