Need server status help // not working?

Status
This thread has been locked.

PurrfectMistake

¬ Owner of AetherTale.com
Premium
Feedback score
10
Posts
307
Reactions
95
Resources
0
ok, so for some reason the person who coded the site i manage didn't set up the query properly to see how many players are online. This is the code where the issue is coming from. Anyone able to help?

HTML:
            <span style="white-space:nowrap;position:absolute;font-size:20px;font-family: 'Open Sans', sans-serif;font-weight:300;color:#F8F8F8;margin-left:500px;margin-top:-20px;">PLAYERS ONLINE: <span style="white-space:nowrap;font-size:20px;font-family: 'Open Sans', sans-serif;font-weight:300;color:#0bcdf6" id="ServerCount2"></span></span>
        </div>
    </div>
    <div id="lowerpart">
    <li id="UserWelcome" style="position:absolute;z-index:9999;margin-left:1400px;margin-top:21px;font-size:18px;font-weight: 300;" class="opt"><i style="margin-top:-27px;" class="fa fa-child"></i>&nbsp;&nbsp;Welcome, <a style="font-weight: 400; font-weight: bold;" id="UserVariable"></a>&nbsp;<a id="UserImg"></a></li><li id="UserAdmin" style="position:absolute;z-index:9999;margin-left:500px;margin-top:21px;font-size:20px;" class="opt"><a style="font-weight: 300;" href="/admin"><i style="margin-top:-27px;" class="fa fa-user"></i>&nbsp;&nbsp;Admin</a></li><span style="position:absolute;z-index:9999;margin-left:1400px;margin-top:21px;font-size:18px;" id="notonline"><a href="/login"><span class="nol" style="color:#f8f8f8; font-weight: bold;">Login</span></a>&nbsp;&nbsp;<span style="color:#f8f8f8;">/</span>&nbsp;&nbsp;<a href="/login/do/register"><span class="nol" style="color:#f8f8f8; font-weight: bold;">Register</span></a></span>
<li id="UserJoin" style="position:absolute;z-index:9999;margin-left:400px;margin-top:21px;font-size:20px;" class="opt"><a href="#" onclick="Enjin_Core.joinWebsiteRegular(event);return false;" rel="nofollow"><i style="margin-top:-27px;" class="fa fa-user"></i>&nbsp;&nbsp;Join Website</a></li>
<!--<li class="opt2" style="position:absolute;right:705px;font-size:15px;font-family:'Open Sans',sans-serif;font-weight:300;top:80px;z-index:1;"><a class="apply" href="/application">Apply for staff</a></li>-->
    <div align="center" id="secondrow">     
        <span style="position:absolute;font-size:20px;font-family: 'Open Sans', sans-serif;font-weight:500;color:#0bcdf6;width:500px;margin-left:auto;margin-right:auto;left:0;right:0;margin-top:14px;">PLAYERS ONLINE: <span style="font-size:18px;font-family: 'Open Sans', sans-serif;font-weight:300;color:#0bcdf6" id="ServerCount1"></span></span>
Java:
$(document).ready(function() {
    function playerCheck() {
        $.ajax({
            type: 'GET',url: 'http://mcapi.us/server/status',data: {ip: 'PLAY.MINEARCH.ORG', keepUpdated: true}
        })
        .done(function(status) {$("#ServerCount1, #ServerCount2").text(status.players.now);});
    }

    playerCheck();

    setInterval(function() {
        playerCheck();
    },5000)

    $("#ServerCount1").click(function() { playerCheck() });
});
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

WulfGamesYT

( ͡° ͜ʖ ͡°)
Supreme
Feedback score
17
Posts
172
Reactions
159
Resources
0
Just tried the code on w3school, if you change
http://mcapi.us/server/status to use https:// instead, then it might work.
Just some tips: Make sure you have a valid jquery CDN linked as well before you use this.
 
Status
This thread has been locked.
Top