• We just upgraded the platform on which this website runs! Please inform @Jaxel of any issues.

Javascript not working???

flakpanda

New member
Hello. I've followed the 1st two tutorials for the functional parts of the scoreboard. I cannot get the JavaScript to update the text. I am not sure what I have done wrong. Could someone please help me understand better what I need to do.

Page HTML:
Code:
<div class="vs_scoreboard" id="vs_scoreboard">
    <div class="players p1" id="players_1">player1</div>
    <div class="players p2" id="players_2">player2</div>
    <div class="scores s1" id="players_1s">11</div>
    <div class="scores s2" id="players_2s">22</div>
</div>

Page JS:
Code:
$('#players_1').text(docData['players_1']);
$('#players_2').text(docData['players_2']);
$('#players_1s').text(docData['players_1s']);
$('#players_2s').text(docData['players_2s']);

Page CSS:
Code:
.vs_scoreboard
{
    position: absolute;
    top: 10px;
    left: 320px;
    width: 1340px;
    height: 40px;
    line-height: 40px;
}

.p1
{
    position: absolute;
    top: 0;
    left: 5;
}

.p2
{
    position: absolute;
    top: 0;
    left: 350px;
}

.scores
{
    height: 40px;
    width: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.s1
{
    position: absolute;
    top: 0;
    left: 270px;
}

.s2
{
    position:absolute;
    top:0;
    left: 615px;
}
 

Attachments

  • Capture.JPG
    Capture.JPG
    28.5 KB · Views: 1