JS functions: is_attached