use html5 api to detect internet or not