因此,我使用的是历史API,我试图使用pushState()函数:
I did this: history.pushState({'a': 'b'}, 'Document', "index2.html");
它给了我这个错误:
Uncaught :未能在“历史”上执行“pushState”:具有URL‘.’的历史状态对象无法在原名为“null”和URL‘.
的文档中创建
发布于 2019-12-27 10:35:59
是这个问题吗?replaceState() with document origin null
如果是这样的话,答案表明这是可行的:
history.replaceState(null,null, window.location.pathname + "your thing here");https://stackoverflow.com/questions/59499337
复制相似问题