Change the code as follows:
$(document).ready(function () {
$.ajax({
type: "POST",
url: "SearchFromHome.asmx/AllCities",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: ....,
error:....
});
});
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public List<City> AllCities()
{
...........
...........
}
Make sure to uncomment
[System.Web.Script.Services.ScriptService]
in your webservice file. I've tested this code and it's working.
Regards...