Where to place the string tag or how to place the ID from the correct foma

Asked

Viewed 29 times

0

Hello, I would like your help, because I can not organize the code, it alone takes but when I implement it on this page there, it does not work. what could change?

Code:

<html>
<head>
<title> Version</title>
</head>
<body onload="loadVersion()">
<div>
<div id="802470398582881273" align="center" style="width: 100%; overflow-y: 
hidden;" class="wcustomhtml">
    Versão :<font id="file1" size="4" color="#515151"></font>
</div>
</div>

<script type="text/javascript">
            //declaração da função JS
            function loadVersion() {
                // ALTERAR ENDEREÇO DO ARQUIVO

$.getJSON('http://teccitystore.com.br/downloads/files_versions.json', 
function(json) {
                    var objs = [[], [], []];
                    for (i=0; i<3; i++) {
                        objs[i] = json[i];
                    }
                    //SETANDO OS VALORES - PEGA ID E PASSA O VALOR DO JSON
                    var file1 = document.getElementById("file1").innerHTML = 
objs[0].filename+ "&nbsp;-&nbsp;v" + objs[0].version;
                    //var file2 = document.getElementById("file2").innerHTML = objs[1].filename+ "&nbsp;-&nbsp;v" + objs[1].version;
                    //var file3 = document.getElementById("file3").innerHTML = objs[2].filename+ "&nbsp;-&nbsp;v" + objs[2].version;            
                });
            };

        </script>

<body>
</html>
  • Is there an error? You are not calling the function.

  • I called her at the beginning of the code on the body, with the "onload"

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.