doubijiao2094 2014-05-21 05:18
浏览 113

使用Safari在iPad上按下按钮抛出错误

I am using the pin it button script to display pin it button on hover.

It's working fine on desktop. But it throwing error on iPad's Safari.

The error: "Safari cannot open the page. because the address is invalid."

I am using code like this:

<div class="pin-it-hover">
   <a href="//www.pinterest.com/pin/create/button/?url=<?php echo current_url(); ?>&media=   <?php echo site_url($imagepath); ?>&description=<?php echo $description; ?>"
    data-pin-do="buttonPin" data-pin-config="none">
   <img src="//assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png"/>
  </a>
</div>

Included script only once.

<!-- Please call pinit.js only once per page -->
<script type="text/javascript" async  src="//assets.pinterest.com/js/pinit.js"></script>

CSS used:

.pin-it-hover {
    right: 20px;
    top :20px ;   
    position: absolute;
    visibility: hidden;
}

.outerdiv:hover .pin-it-hover {
    visibility: visible;
}

Any suggestion? What's wrong with my code?

  • 写回答

1条回答 默认 最新

  • dt97868 2014-05-21 05:25
    关注

    Use http: in front of URLs or remove // in every urls like below.

    http://assets.pinterest.com/js/pinit.js or assets.pinterest.com/js/pinit.js

    instead of //assets.pinterest.com/js/pinit.js

    <div class="pin-it-hover">
       <a href="http://www.pinterest.com/pin/create/button/?url=<?php echo current_url(); ?>&media=   <?php echo site_url($imagepath); ?>&description=<?php echo $description; ?>"
        data-pin-do="buttonPin" data-pin-config="none">
       <img src="http://assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png"/>
      </a>
    </div>
    

    I think this will helps you.

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向