When we use Ajax we can't get its properties. Under normal circumstances are:
<script type= "Text/javascript";
function Useajax (Sendurl, Name) {
$.ajax ({
type: "POST",
Url:sendurl,
data: {txtcode: $ ("#txtCode"). Val ()},
datatype: "JSON",
timeout:20000,
success:function (JSON) {
Properties that cannot be used
alert (json.msg);
},
Error:function (XMLHttpRequest, Textstatus, Errorthrown) {
}
} );
}
</script>
If you cannot eject its normal property value, you need to resolve it in the following way:
<script type= "Text/javascript" >
function Useajax (sendurl,name) {
$.ajax ({
Type: "POST",
Url:sendurl,
Data: {txtcode: $ ("#txtCode"). Val ()},
DataType: "JSON",
timeout:20000,
Success:function (JSON) {
Normal use of properties
Json=json.decode (JSON);
},
Error:function (XMLHttpRequest, Textstatus, Errorthrown) {
Alert (1);
}
} );
}
</script>
Ajax return data cannot be resolved with its properties