Hi Dw, I want to get the keys and data of the php json response, heres the response I get

{"content":{"1":{"title":"Present","start":"2025,01,29","end":"2025,01,29","backgroundColor":"#f39c12","borderColor":"#f39c12"}}}

all I'm interested in starts from title.

This is what i'm using for AJAX requests - it needs jQuery:

var data = [];
data.var = 'test';
$.ajax({
    type: "POST",
    data: {data:data},
    url: connectProtocol+"://"+currentHost+"/linkToAjaxFile.php",
    success: function(msg){
        responseData = $.parseJSON(msg);
        console.log(responseData);
        if(responseData['status'] == 'success'){
            //do something
            $('#someModalWindow').modal('hide');

        }else{
            alert(responseData['message']);
        }
    }
});

I guess the direct answer would be using jQuery for $.parseJSON(msg);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.