How do I make a value in JS appear in html content?
app.js
// BUSCA OCORRENCIAS
$("#menuOcorrencia").click(function() {
var operacao = "selectOcorrencias";
$.getJSON("http://url.com.br/appOperacoes.php", {operacao:operacao,condominioID:condominioID}, function(selectOcorrencias){
for (var seOcor in selectOcorrencias){
document.write(selectOcorrencias[seOcor].ID_Ocorrencia + selectOcorrencias[seOcor].morador + "<br />");
}
});
});
part of the html that is in index.html
<div class="list-group widget uib_w_44 d-margins" data-uib="twitter%20bootstrap/list_group" data-ver="1">
<a class="list-group-item allow-badge widget uib_w_45" data-uib="twitter%20bootstrap/list_item" data-ver="1" id="btnOcorrenciaVer">
<h4 class="list-group-item-heading">Heading</h4>
<p class="list-group-item-text">List item</p>
</a>
</div>
FOR should happen by listing the result of the BD.
Example:
InHeadingwouldbeselectOcorrencias[seOcor].ID_Ocorrencia
andinListitemwouldbeselectOcorrencias[seOcor].morador
ThisDIVisunique,asifyouaregroupingallthelists.So: