【问题标题】:Whatsapp button working on Android but Blank on IOSWhatsapp 按钮可在 Android 上运行,但在 IOS 上为空白
【发布时间】:2015-06-29 14:57:00
【问题描述】:

此代码在三星 Galaxy Tab 和 S3 等 Android 设备上运行良好。选择联系人后,它会出现 TheTitle -> TheURL。

但它不适用于 iPhone 6 plus 和 iPhone 5 等 iOS 设备。选择联系人后,TheTitle -> TheURL 不会出现,它只是空白。

我该如何解决这个问题?

var TheTitle = "post Title Text", TheURL = "blog.com/url-post.html";

$('#myID').after('<a class="button-share whatsapp" data-action="share/whatsapp/share" href="whatsapp://send?text=' + TheTitle + ' -> ' + TheURL + '" target="_blank">WhatsApp</a>');

【问题讨论】:

    标签: javascript android jquery ios whatsapp


    【解决方案1】:

    解决了。

    文本值必须在 iOs Whatsapp 上编码。

    var TheTitle = "post Title Text", 
        TheURL = "blog.com/url-post.html",
        nuklear = TheTitle + ' ›› ' + TheURL,
        bomb = encodeURIComponent(nuklear);
    $('#myID').after('<a class="button-share whatsapp" data-action="share/whatsapp/share" href="whatsapp://send?text=' + bomb + '" target="_blank">WhatsApp</a>');
    

    已测试:可在 Android 和 iOS 上运行

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-01
      • 2023-01-03
      • 2021-12-07
      • 2021-10-27
      • 2016-01-05
      • 2014-10-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多