【发布时间】:2019-12-27 10:28:28
【问题描述】:
所以我正在使用 History API 并尝试使用 pushState() 函数:
I did this:
history.pushState({'a': 'b'}, 'Document', "index2.html");
它给了我这个错误:
未捕获的 DOMException:无法在“历史”上执行“pushState”:无法在源为“null”且 URL 为“...”的文档中创建 URL 为“...”的历史状态对象。
【问题讨论】:
标签: javascript api history.js