![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
26/06/2015, 15:24
|
![Avatar de asassa](http://static.forosdelweb.com/customavatars/avatar250627_1.gif) | | | Fecha de Ingreso: julio-2008 Ubicación: En el DF ectuoso
Mensajes: 240
Antigüedad: 16 años, 6 meses Puntos: 0 | |
Respuesta: Como buscar en un json Hola muchas gracias me funciono como me lo mostraste.. y con con jquery $.getJSON
$.getJSON('VyrSitPerfil.json', function(contjsonsitperfil){
// var json = [{"label":"CONSULTA","value":"CON"},{"label":"GENER AL","value":"GRAL"},{"label":"GERENTE","value":"GT E"},
{"label":"ASESOR","value":"ASE"}];
function obtener(valor){
for(var i = 0; i < contjsonsitperfil.length; i++){
if(contjsonsitperfil[i].value == valor)
return contjsonsitperfil[i].label;
}
}
var datos = 'CON';
alert (obtener(datos));
})
Última edición por asassa; 26/06/2015 a las 15:46 |