Weird behavious in JQuery.ajax()

Weird behavious in JQuery.ajax()

The code below is part of an autocomplete input created using JQuery UI.
But my question here is related to the JQuery-AJAX part only.

  1.     change: function(event, ui){
  2.     $.ajax({
  3.     type: "POST",
  4.     url: "includes/c_t_v_choices.php",
  5.     data: { filter: ui.item.value },
  6.     //dataType: "JSON",
  7.     }).done(function( msg ) {
  8.         c_t_v_choices = msg;
  9.         alert( "Data Saved: " + c_t_v_choices );
  10.         $("#c_t_v").autocomplete("option", "source", c_t_v_choices);
  11.     });

The last line in the c_t_v.php file is:

  1.     echo json_encode($return_arr);

The way the code is currently, I see valid data in the alert, sent by the php file. An example is shown below:

  1.     Data Saved: [{"label", "value"}, {"label", "value"}...]

However, when I enable the line:

  1.     dataType: "JSON",

I see something like:

  1.     Data Saved: [object: Object], [object: Object]

Can anyone please help me understand why this weird behavior?

On a side note, any idea why $("#c_t_v").autocomplete is accepting the source i am providing in the code below (which is part of the code above):

  1.     $("#c_t_v").autocomplete("option", "source", c_t_v_choices);