检查支持

检查浏览器是否支持振动

if ('vibrate' in window.navigator)
    // browser has support for vibrations
else
    // no support