URL

打开一个URL(ctrip://, http://, /xx/ ...)

接口说明:

static openURL(url)

static openURLWithTitle(url, title = '')

第二个参数为下一个面 title,HTTP(S) 与 / 开头的 H5 页面才有效。

static openURLWithCallback(url, callback)

第二个参数为下一个页面回来时的回调,可以带回一些数据,待打开的页面上是 Hybrid 页面才有效。具体可以参考:页面跳转/传值/回调

static openURLWithTitleAndCallback(url, title = '', callback)

示例:

URL.openURL("http://m.ctrip.com/webapp/forex/index?bid=1");
URL.openURLWithTitle("http://m.ctrip.com/webapp/forex/index?bid=1", '默认标题');
URL.openURLWithCallback("http://m.ctrip.com/webapp/forex/index?bid=1", (data) =
>
 {console.log(data)});
URL.openURLWithTitleAndCallback("http://m.ctrip.com/webapp/forex/index?bid=1", '默认标题', (data) =
>
 {console.log(data)});

results matching ""

    No results matching ""