Ver Mensaje Individual
  #6 (permalink)  
Antiguo 26/06/2015, 15:24
Avatar de asassa
asassa
 
Fecha de Ingreso: julio-2008
Ubicación: En el DF ectuoso
Mensajes: 240
Antigüedad: 15 años, 9 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