In cases where danger or serious inconvenience to the public may ensue from the demolition or erection of a building on any site; the local municipality may require that the owner of such site, before such work is commenced, shall erect a fence, hoarding or barricade to prevent the public from entering such site and to protect them from the activities on such site.