账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    前端js如何调用OC传参呢
    17
    0

    我是前端js,需要通过OC向安卓和ios传4个参数,他们做分享功能,然后返回我是不是分享成功了。
    请问应该怎样实现呢,最好没有兼容问题,现在安卓和ios版本都这么新了。我现在用的这种方式似乎不够安全。

    <html>
    <header>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <script type="text/javascript">
            function showAlert(message) {
                alert(message);
            }
    
            function loadURL(url) {
                var iFrame;
                iFrame = document.createElement("iframe");
                iFrame.setAttribute("src", url);
                iFrame.setAttribute("style", "display:none;");
                iFrame.setAttribute("height", "0px");
                iFrame.setAttribute("width", "0px");
                iFrame.setAttribute("frameborder", "0");
                document.body.appendChild(iFrame);
                iFrame.parentNode.removeChild(iFrame);
                iFrame = null;
            }
            function firstClick() {
                loadURL("firstClick://shareClick?title=分享的标题&content=分享的内容&url=链接地址&imageUrl=图片地址");
            }
    
        </script>
    </header>
    
    <body>
        <button type="button" onclick="firstClick()">Click Me!</button>
    </body>
    
    </html>
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 独爱流浪 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    网站公告
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部