问题描述:

I am using the google places api library and have come upon a problem, I am needing to see if the array is empty e.g if any photo exists

I have tried a few things, this being one of them.

var photoz = place.photos;

if (photoz[0] != null) {

alert('ok');

}

does anybody have any proposals to this problem.

网友答案:
if(place.photos != undefined){
    alert('ok');
}

It means that there is a photos tag in it.

网友答案:

you can also try this.

if(place.photos){
   alert('photo tag exist');
}
相关阅读:
Top