resultTXT に何も表示できないという私のコードの何が問題になっていますか
txtfld は配列を示します
[{
"user_id": "2790",
"freelancer_name": "",
"order_id": "9121",
"orderamount": "0.00",
"payment_method": " ....... "
}]
ユーザーIDをresultTXTに入れたい
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
$.post('userfind.php', function(data) {
$("#txtfld").val(data);
var json = data,
obj = JSON.parse(json);
alert(""+obj.user_id);
$("#resultTXT").val(obj.user_id);
},'json');
}
};
ajaxRequest.open("POST", "userfind.php", true);
ajaxRequest.send(null);
何を変更する必要があるか教えてください。