跳转到指定的 url

[!TIP|labelVisibility:hidden|iconVisibility:hidden] navigator.webView.load(url, options)

支持平台:

  • Android
  • iOS

参数说明

参数 类型 必填 说明
url String 跳转 url
options Object 参数对象

options 为参数对象,其属性可包含一下一项或多项:

  • clearHistory(Boolean / 可选),是否清除 webView 历史记录,默认 false(设置为true``Android的物理返回键会失效)

    • true -- 清除 webView 历史记录
    • false -- 不清除 webView 历史记录
  • loadUrlTimeoutValue(Int/ 可选) -- 超时时间(ms),默认10000 ms

示例代码

// 引用js
<script src='supconit://hcmobile.js'></script>
<script>
    // 监听’deviceready‘事件
    document.addEventListener('deviceready', onDeviceReady, false)
    function onDeviceReady(){
        // 加载指定网页
        navigator.webView.load('https://www.baidu.com', {'loadUrlTimeoutValue': 15000, 'clearHistory': false});
    }
</script>

results matching ""

    No results matching ""