【问题标题】:How to add Whastapp share button with images in Cpanel?如何在 Cpanel 中添加带有图像的 Whatsapp 共享按钮?
【发布时间】:2020-07-14 09:34:36
【问题描述】:

我在我的 php 文件中添加了这段代码:

<script type='text/javascript'>if(typeof wabtn4fg===&quot;undefined&quot;){wabtn4fg=1;h=document.head||document.getElementsByTagName(&quot;head&quot;)[0],s=document.createElement(&quot;script&quot;);s.type=&quot;text/javascript&quot;;s.src=&quot;https://cdn.jsdelivr.net/whatsapp-sharing/1.3.4/whatsapp-button.js&quot;;h.appendChild(s);}</script>
<a class='wa_btn wa_btn_l' expr:data-href='data:post.url' expr:data-text='data:post.title' href='whatsapp://send' style='display:none'>Share this Article!</a>

但没有显示。完整代码:

<div class="article-header">
                                        <img src="images/news/<?php echo $news['photo']; ?>" class="article-photo" alt="" />
                                        <div class="article-meta">
                                            <div class="meta-date">
                                                <span class="date"><?php echo substr($news['tanggal'],8,2) ?></span>
                                                <span class="month"><?php echo substr($news['tanggal'],5,2)?>, <?php echo substr($news                      ['tanggal'],0,4) ?> </span>
                                                <span class="author">by <a href="#"><?php echo $news['penulis']; ?></a></span>
                                                </div>
                                                <script type='text/javascript'>if(typeof wabtn4fg===&quot;undefined&quot;){wabtn4fg=1;h=document.head||document.getElementsByTagName(&quot;head&quot;)[0],s=document.createElement(&quot;script&quot;);s.type=&quot;text/javascript&quot;;s.src=&quot;https://cdn.jsdelivr.net/whatsapp-sharing/1.3.4/whatsapp-button.js&quot;;h.appendChild(s);}</script>
<a class='wa_btn wa_btn_l' expr:data-href='data:post.url' expr:data-text='data:post.title' href='whatsapp://send' style='display:none'>Share this Article!</a>
                                                <div class="meta-tools">
                                                <span><i class="fa fa-text-height"></i>Ukuran Font <span class="f-size"><a href="#font-size-down">-</a><span class="f-size-number">16</span><a href="#font-size-up">+</a></span></span>
                                            </div>
                                        </div>
                                    </div>

【问题讨论】:

  • 我在黑名单吗? 11 人的浏览量

标签: javascript php html css cpanel


【解决方案1】:

在您的&lt;script&gt; 标记中,将所有&amp;quot;s 替换为'

此外,该脚本仅适用于移动设备。它会在加载时检查用户代理,并且仅当用户设备是 android 或 ios 时才会显示。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-28
    • 2014-09-05
    • 2020-07-21
    • 1970-01-01
    • 1970-01-01
    • 2015-11-20
    相关资源
    最近更新 更多