dataType: “json” won't work

前端 未结 7 1424
面向向阳花
面向向阳花 2020-12-10 16:19

I\'m trying to send back multiple variables from a php file to ajax using json in an array. The code in the php file works perfectly and does everything with my database lik

7条回答
  •  醉梦人生
    2020-12-10 16:52

            $.ajax({
        
           url: '/route/',
           type: 'POST',
           dataType: "json",
           data: 
           {
              type: "add",
              comment: $("#comment").val(),
              id: videoID  
           },
           success: data => {console.log(data);}
        
        });
        
         "$realid", "un" => "$username", "date" => "$date"));
        ?>
        
            
    

提交回复
热议问题