Get JSON object from AJAX call

前端 未结 7 1521
难免孤独
难免孤独 2021-01-17 12:00

I\'m new to AJAX and javascript. In my project, I have to get a json object in my javascript file. I\'ve used spray

7条回答
  •  滥情空心
    2021-01-17 12:30

    i think you just printing the object.Try someting like this

    $.ajax({
        url: 'http://localhost:8081/all-modules',
        dataType: 'application/json',
        complete: function(data){
            alert("status = "+data.status+"descripttion"+data.description);
        },
        success: function(data){
             alert("status = "+data.status+"descripttion"+data.description);
        }
    

提交回复
热议问题