indexof初识
window.navigator.userAgent,window.navigator.userAgent.indexOf('Chrome'),在判断浏览器是否兼容的时候,如果userAgent字符串中包含“Chrome“那么console.log(window.navigator.userAgent,window.navigator.userAgent.indexOf('Chrome'))之后就出打印出chrome第一个字节在这段字符串中的位置。
window.navigator.userAgent,window.navigator.userAgent.indexOf('Chrome'),在判断浏览器是否兼容的时候,如果userAgent字符串中包含“Chrome“那么console.log(window.navigator.userAgent,window.navigator.userAgent.indexOf('Chrome'))之后就出打印出chrome第一个字节在这段字符串中的位置。