我有以下推送状态:
history.pushState(null, null, 'category/item');而项目是动态替换的。
现在,这用于点击我的菜单链接。 第一次pushState很好地工作并重写url。 但之后它不再起作用了。
为什么pushState有正斜杠的问题?
有没有办法在其中使用带斜杠的字符串? 或者我必须以某种方式逃脱它们?
我对这个问题感到很疯狂
谢谢你的帮助
I have the following push state:
history.pushState(null, null, 'category/item');whereas item is replaced dynamically.
Now this is used on click of my menu links. The first time the pushState works nicely and rewrites the url. But after that it doesn't work anymore.
Why does pushState have problems with forward slashes ?
Is there a way to use strings with slashes in them ? Or do I have to escape them somehow ?
I'm going crazy with this issue
Thank for helping out
最满意答案
好的,所以我很愚蠢到没有在新网址之前放一个正斜杠。 这导致pushState不能很好地路由到root。使用斜杠它可以很好地工作
Ok so I was stupid enough to just not put a forward slash before the new url. This caused the pushState to not route to the root nicely With the slash it works nicely
更多推荐
发布评论