【问题标题】:How to open URL in WebView through .js in cocos creatorcocos creator中如何通过.js打开WebView中的URL
【发布时间】:2018-11-28 12:37:41
【问题描述】:

我想打开任何这样的网址(https://example.com/mPayment/api.php?playerid=name&method=init) 在我的 WebView 中通过脚本编码而不是来自 CocosCreator 中的设计视图。 我已经完成了这段代码,但它没有打开我做错的地方,

var url =  "https://example.com/mPayment/api.php?playerid=name&method=init";
        this.webPage._url = url;
        console.log("Webview1111111  ==== ", this.webPage._url);

在 url 上有我想要传递玩家 ID 的名称。 我很想在我的 cocos creator 游戏中实现支付网关。

【问题讨论】:

    标签: cocos2d-x cocos2d-js cocoscreator


    【解决方案1】:

    工作正常:

    this.webView.url = this.editBox.string;
    

    也许您忘记在设计器中将 webView 绑定到 UI 元素。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多