使用Ironman为FIBOS BP网站部署投票代码

2018-09-03  本文已影响0人  ansenyu

现在,FIBOS 超级节点BP只需要在网站部署几行代码就可以调用Ironman浏览器插件,用户就可以自己一键投票啦。

废话不说,以Ironman网站举例:

  <!-- 页面上添加一个元素,id设置为vote_with_ironman -->
  <script type="text/javascript" src="https://qcloudtest-1256426052.cos.ap-guangzhou.myqcloud.com/fibos.20180902.js"></script>
  <script type="text/javascript" src="https://ansenyu.github.io/js/bignumber.min.js"></script>
  <script type="text/javascript" src="https://ansenyu.github.io/js/vote.js"> </script>
  <script type="text/javascript">
        // 设置要投票的BP的账号
        const bp2vote = "ansenironman"

      $('#vote_with_ironman').on('click', function (event) {
        event.preventDefault();
        if (null == window.ironman) {
            alert("请先安装Ironman浏览器插件(foironman.com)");
        }
      });
  </script>

搞定!就是这么简单,效果请上foironman.com上体验,谢谢!

上一篇 下一篇

猜你喜欢

热点阅读