anu icon indicating copy to clipboard operation
anu copied to clipboard

ie8下,iframe打开页面会报未指明的错误

Open ZyJoey opened this issue 8 years ago • 6 comments

用iframe打开一个新页面 新页面会报如下错误 经排查是由document.adctiveElement 引起~ Alt text image

在网上找了一下解决方式 说加入以下代码能解决~请问这个能由框架自行处理吗?

<script type="text/javascript">
  document.documentElement.focus();
</script>

ZyJoey avatar Nov 14 '18 10:11 ZyJoey

是跨域了吗

RubyLouvre avatar Nov 14 '18 15:11 RubyLouvre

把throw e 注释掉吧

RubyLouvre avatar Nov 14 '18 15:11 RubyLouvre

没有跨域,注释throw e有什么用啊……iframe还是会渲染不出来啊……

https://developer.mozilla.org/zh-CN/docs/Web/API/Document/activeElement

image 好像跟这个bug有关系~?

ZyJoey avatar Nov 15 '18 02:11 ZyJoey

不知,没有试过放在iframe中

RubyLouvre avatar Nov 15 '18 14:11 RubyLouvre

1.4.9(2018.11.17)

  1. 重构小程序dispathEvent与dispatchEventQuick的实现
  2. 重构 快应用toStyleQuick
  3. 修复miniCreateClass 不能继承父类的类成员的BUG(PC中的React内部的组件继承用到它,及小程序的各种React的toClass方法的本体就是它)
  4. 修复事件回调函数中调用e.preventDefault()后,e.defaultPrevented 仍然为 false
  5. 修复用iframe打开一个新页面 document.adctiveElement 抛出异常,导致无法渲染的BUG
  6. 修复 devtools 的两个问题
    • 点击 Unbatch 后开发者工具变为空白。
    • devtools 中 Text 节点的文字显示为 undefined。

1.4.8(2018.11.7)

  1. 支持编译成支付宝小程序,通过在<anu-xx instanceUid={uuid}>这种机制解决支付宝小程序的实例生成顺序与React实例生成顺序不一致的问题
  2. 修复快应用的文本节点不显示问题,自动为它添加标签包含它
  3. 添加patchComponent机制
  4. 修复样式表中的@assets别名问题

1.4.7(2018.10.29)

  1. 微信小程序的组件机制由template改成自定义组件机制实现, 解决文本节点保留换行符的问题
  2. 支持编译成百度智能小程序
  3. 支持编译成快应用
  4. 模板的开发目录改成source,生产目录视构建目标有所不同

RubyLouvre avatar Nov 16 '18 16:11 RubyLouvre

 function safeActiveElement() {
        try {
            return document.activeElement;
        } catch (e) {}
    }
    function insertElement(fiber) {
        var dom = fiber.stateNode,
            parent = fiber.parent;
        try {
            var insertPoint = fiber.forwardFiber ? fiber.forwardFiber.stateNode : null;
            var after = insertPoint ? insertPoint.nextSibling : parent.firstChild;
            if (after == dom) {
                return;
            }
            if (after === null && dom === parent.lastChild) {
                return;
            }
            Renderer.inserting = fiber.tag === 5 && safeActiveElement();
            parent.insertBefore(dom, after);
            Renderer.inserting = null;
        } catch (e) {
            throw e;
        }
    }

https://rubylouvre.github.io/anu/ch/version.html

RubyLouvre avatar Nov 16 '18 16:11 RubyLouvre