0

Does anyone know what this code is?

+= ">

20th May 2019, 2:19 PM
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢 - avatar
9 odpowiedzi
+ 1
Looks incomplete, so hard to say without you posting the full code. Typically, += is equiv of: LeftValue = LeftValue + RightValue or Variable = Variable + RightValue EXAMPLE: int myVar = 5; myVar += 2; // myVar = myVar + 2 .... result is 7
20th May 2019, 2:27 PM
AgentSmith
0
Yes but I dont know this part. "> J... Allow code
20th May 2019, 3:14 PM
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢 - avatar
0
The code: // Graficos - http://googleweblight.com/i?u=http://www.linhadecodigo.com.br/artigo/1506/grafico-em-barra-com-javascript.aspx&hl=pt-BR function Empresa() {  // CADASTRAR EMPRESAS this.Nome; this.Area; this.CrescimentoAnual; this.CorBarra; } function ExibirLabel(obj,Id) {// Propriedades: ADICIONAMOS AO DIV LABELGRAFICO O CONTEUDO DE CADA OJETO // EMPRESA PASSADO POR ELE var alvo = document.getElementById("​LabelGrafico"+Id); alvo.innerHTML = ""; alvo.innerHTML = "<b>"+ obj.Nome +"</b><hr>"; alvo.innerHTML += "Area de atuação: "+obj.Area; alvo.innerHTML += "<br />Cresimento Anual: "+obj.CrescimentoAnual + "%"; alvo.style.display = ""; } function OcultarLabel(Id) {// SIMPLESMENTE ESTAMOS OCULTANDO O ID CORRENTE. var alvo = document.getElementById("​LabelGrafico"+Id); alvo.style.display = "none"; } function Graficos(dados){ var Abarra = 19; // altura da barra var Lbarra = 0; // largura da barra var calc_largura = 0; // calculo da largura da barra var calc_percent = 0; // calculo do percen
20th May 2019, 3:15 PM
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢 - avatar
0
function Graficos(dados){ var Abarra = 19; // altura da barra var Lbarra = 0; // largura da barra var calc_largura = 0; // calculo da largura da barra var calc_percent = 0; // calculo do percent de valores var construtor = ""; // responsavel por montar todo o grafico var total = 0; // contabilizador de valores var i; //AQUI ESTAMOS SOMANDO O CRESIMENTO ANUAL // DE CADA EMPRESA for (i = 0; i <dados.length;i++) { total+=parseInt(dados[i].CrescimentoAnual); } Lbarra = total; //NOSSA CONSUTRUÇÃO COMEÇA AQUI! construtor = "<table id='tbGrafico' border='0' cellspacing='2' cellpadding='0'>" for (i=0;i<dados.length;i++){ // CALCULO PARA PERCENTE DE CADA EMPRESA. calc_percent = Math.round(dados[i].CrescimentoAnual*100/total); calc_largura = Math.round(Lbarra*(calc_percent/100)); construtor += "<tr><td><div id='LabelGrafico'+i+'' class='csslabel' "; construtor += "> J" var dados =new Array() dados[0] = empresa = new Empresa(); dados[0].CorBarra ="#CCFFCC"; dados[0].Nome = "LINHA DE CÓDIGO"; dados[0].C
20th May 2019, 3:18 PM
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢 - avatar
0
It's just concatenating the strings together. So the += is taking what's already part of the string, and then it's adding "> J" to the end of it. The > is simply closing the DIV tag, and I've no clue their intention with the J part, but I only speak English so it very well may be that I don't understand the J part because of my language.
20th May 2019, 3:24 PM
AgentSmith
0
In the original code it's constructor += "> J
20th May 2019, 3:46 PM
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢 - avatar
0
It's calculing percents for each enterprise
20th May 2019, 3:48 PM
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢 - avatar
0
Calc_percent and calc_largura. Largura = width
20th May 2019, 3:50 PM
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢 - avatar
0
So it has a constructor or to give form. First, one table, one row and cell, one div with id LabelGrafico e i (array) and class style. The constructor again with these notation, "> J
20th May 2019, 3:54 PM
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢
Lυƈιҽɳҽ Bυʅԋõҽʂ Mαƚƚσʂ 🐢 - avatar