Bom dia, sou novo aqui e tenho uma dúvida.
Tenho que criar uma lista de ramais editável, coisa básica só que não tanto para mim.
Sou iniciante, e queria que ao entrar na página ela já puxasse e carregasse a table com dados de um json.
E depois queria que pudesse ser editável e fosse possível salvar o alterado no próprio json. Já tenho algumas coisas
HTML
<body>
<script id="templateStructure" type="text/x-jquery-tmpl">
<tr>
<td>$(Nome)</td>
<td>$(Ramal)</td>
<td>$(E-mail)</td>
<td>$(Celular)</td>
</tr>
</script>
<script type="text/javascript">
$(document).ready(function() {
$(function() {
$.getJSON("dados.json",function(data){
$('#templateStructure').template('myTemplate');
$.tmpl('myTemplate', data.funcionarios).appendTo('#templateTable');
});
});
});
</script>
<table border="1" id="templateTable">
<tbody>
<tr>
<th>Nome</th>
<th>Ramal</th>
<th>E-mail</th>
<th>Celular</th>
</tr>
</tbody>
</table>
</body>
JSON
{
“funcionarios”:[
{
“Nome”:“Romulo”,
“Ramal”:“2222”,
“E-mail”:"romulo@teste.com",
“Celular”:"(11)8945-7889"
},
{
“Nome”:“Will”,
“Ramal”:“3333”,
“E-mail”:"will@teste.com",
“Celular”:"(11)8945-7853"
}
]
}
PORÉM, não está carregando! Podem me ajudar?