Accessing json does not work

后端 未结 3 1511
臣服心动
臣服心动 2021-01-28 22:32

I am using Ajax to receive a JSON update:

    $(document).ready(function(){
    $(\'form\').submit(function(event){
        event.preventDefault();
        var f         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-28 23:35

    Your array only has one element, so you want to use 0 as your index:

    alert(data[0].text);
    

提交回复
热议问题