The user logs in, queries the ranking list, how to obtain the ranking value through js, and reminds people within 30 people who are eligible to register through alert.
Mr.Lv
Mr.Lv 2019-07-19 11:17:42
0
7
1269
<div class="row">
    <div class="col-lg-12">
        <div class="form-group mb-3">
            <div class="form-control text-center" >您的积分总和为:{$score['perfor_sum']} 当前排名第<span id="ranking">{$ranking['perfor']}</span>位</div>
        </div>
    </div> <!-- end col -->
</div>

微信图片_20190719111634.png

<script>
    var oDiv = document.getElementById('ranking');
    alert(oDiv.innerHTML);
</script>

微信图片_20190719111723.png

Mr.Lv
Mr.Lv

reply all(2)
樂成

Just add judgment. For error reporting, please refer to https://www.php.cn/blog/detail/14059.html


  • reply still empty
    Mr.Lv author 2019-07-19 14:47:05
  • reply 1. Take a look at the examples in the link 2. Your data was not obtained
    kanglecheng author 2019-07-19 14:50:40
  • reply I’ve tried all of your 1, 2, and 3 writing methods, but the data is not obtained.
    Mr.Lv author 2019-07-19 15:11:34
  • reply Data output from the background {$ranking['perfor']}
    kanglecheng author 2019-07-19 16:33:34
  • reply <span id="ranking"></span>Your tag must exist first. If you add judgment later and then render it, an innerHTML error will be reported.
    kanglecheng author 2019-07-19 16:37:49
樂成

Can’t reply? ?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template