[JavaScript] iframe更改了src后,父页面history.back只能后退iframe而不能使自己后退解决办法
浏览器的机制如此,在iframe导航变化后手动点击浏览器的后退按钮也依然只是后退iframe中的导航。
有一种解决方案是不要修改iframe.src,而是删除旧iframe元素,新建一个iframe元素并替换它,这样不会产生history。
直接createElement,替换原来的iframe。
------------------------------------------------------------------
Always put yourself in the other's shoes.If you feel that it hurts you,it probably hurts others,too.------------------------------------------------------------------
浙公网安备 33010602011771号