首页 文章

Uncaught SecurityError:无法在'History'上执行'pushState':带URL的历史状态对象

提问于
浏览
2
window.history.pushState({
  id: cat_id
}, 'Viewing item #35', SITE_URL + '?' + cat_key + '/' + brand_key);

view_carrier_now.js:33 Uncaught SecurityError:无法在'History'上执行'pushState':无法在文档中创建URL为'http:// www.dmvbuyback .com /?iPhone / iPhone-5c'的历史状态对象原产地'http://dmvbuyback.com'和网址'http://dmvbuyback.com/index.php' .

工作没有改变任何东西,但管理面板中的一些价格现在给出了这个错误 .

1 回答

  • 0

    问题似乎是 SITE_URL 中的值与当前地址不匹配 . SITE_URL 有“http://www.dmvbuyback.com/ " while the current address is " http://dmvbuyback.com/” . 我在chrome调试器中做了一点测试并得到了类似的结果:

    enter image description here

    看起来如果要从 SITE_URL 中删除"www.",它可能会起作用 .

相关问题