【问题标题】:When does the onLoad function of React Native webview execute?React Native webview的onLoad函数什么时候执行?
【发布时间】:2019-10-11 06:19:07
【问题描述】:

https://facebook.github.io/react-native/docs/webview#onload

文档指出 onload 是Function that is invoked when the WebView has finished loading.

具体是什么动作触发了这个?它是在页面中的所有脚本都运行后触发还是仅在 DOM 完成加载时触发?是否有执行回调告诉 webview 页面已完成?

【问题讨论】:

    标签: javascript react-native react-native-webview


    【解决方案1】:

    https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event

    当 DOMContentLoaded 事件被触发时,React Native 的 webview 被启动。这意味着 DOM 已完成加载,但网站不一定已完全加载所有内容,此时可能会继续运行脚本(如果有的话)。

    【讨论】:

      猜你喜欢
      • 2019-09-04
      • 2020-07-07
      • 2016-12-26
      • 1970-01-01
      • 1970-01-01
      • 2012-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多