Hello All,

I am trying to complete an Ajax request in which PHP returns a JSON-
formed string. One of the variables inside the JSON object contains a
path, which contains backslashes. This seems to cause a problem
because nothing in the success function seems to run. So, I tried
cleaning the data using dataFilter, but cannot seem to get that to
work either. Anybody have any insight on how to accomplish this?

CODE:
    $.ajax({
        async: false,
        type: "POST",
        url: ajaxHandler,
        dataType: "json",
        data: "action=getInformation&id=" + id,
                dataFilter: function(data,type) {
                        data.replace(/\\/g,"\\\\");
                        return data;
                },
        success: function(return){
            objInformation = return.detail[0];
        }
    });

Reply via email to