consider i have an json array like this
["map14","map20","map21","map22","map23","map24","map25","map31","map32","map33","map34","map35","map36","map37","map40","map41","map42","map46","map49","map50"]
with this json array i need to check if my passed value exists need to do some operation or otherwise some other operation....
javascript code:
function pop(e,id) {
$.getJSON( 'layoutcheck.php', { some_get_var: 1 }, function(output){
var i=0, total = output.length;
for ( i = 0; i < total; ++i ) {
if(isArray(output[i]==id)) {
// do soome stuff if the value exists in the database
}
else{
// if not exists some other operation
}
}
});
}
</script>
layoutcheck.php will fetch the information from the database and create a json array..
but the code fails to display output.. please rectify me ..
thanks