Jquery Ajax Message reading techniques

It is a time where almost every Asp.net web developer is aware of Jquery, its usage and ajax.
Using Jquery Ajax in Asp.net with JSON is no more a hot topic.



This is one of the ajax example below.


function LoadDropDown() {
$.ajax({
type: "POST",
url: "http://localhost/Line/JqueryMethods/JqueryAjax.aspx/LoadCountries",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
$("<option value='0'>Select</option>").appendTo('#<%=ddlCountries.ClientID %>');
$('#<%=imgCountry.ClientID %>').attr("Src", ("Common/_assets/img/flags/XX.png"));
for (var i = 0; i <= msg.d.length - 1; i++) {
$("<option value='" + msg.d[i].ID + "'>" +
  msg.d[i].COUNTRY1 + ":" + msg.d[i].TLD + "</option>").appendTo('#<%=ddlCountries.ClientID %>');
                    }
}
});
}

here I want to show how to read the return value of the server side method.
I had a big issue once with asp.net 2.0 , 3.5 and different version of jquery.
so if any one have issues on how to read the return values then here is below
note: above example is reading a List<> object.

1. msg
function(msg) {
$('#Divid').html(eval(msg)) ;
},
2. msg.d
function(msg) {
$('#Divid').html(eval(msg.d)) ;
},

3. eval('(' + msg + ')').d
function(msg) {
$('#Divid').html(eval('(' + msg + ')').d)
},


I spent more than 4 hrs on this ways because of no clue, whether using 3.5 sp1, or different versions of jquery. But just using "debugger;" we can easily findout which is suitable.

Happy coding ;)