Here is my code. Can anyone tell me why the simple array.length is not working here?
frappe.ui.form.on(“Bank Master”, {
pin_code: function(frm) {
$.ajax({
url: "https://maps.googleapis.com/maps/api/geocode/json?address="+frm.doc.pin_code+"&key=xxxxxx",
type: 'POST',
dataType: 'json',
success: function (data, textStatus, xhr) {
var fruits = ["Banana", "Orange", "Apple", "Mango"];
msgprint(__(fruits.length));
},
error: function (data, textStatus, xhr) {
msgprint(__("Failure!!"));
},
});
}
});
Pass html or String as message to msgprint
.
Try,
msgprint(cstr(fruits.length))
for details check,
Thanks for your suggestion. Actually It was just not printing. I checked it on console output, it was giving expected length.