GithubHelp home page GithubHelp logo

detect.js's Introduction

mix.core.util.Detect

统一环境检测包。

当前版本:V0.2.1


detect

环境检测核心文件(core)

包含以下组件(plugin):

Network

网络状况检测

UA

用户代理检测

Ability

能力检测(incoming)

Hardware

硬件检测(incoming)

DeviceAPI

设备API检测(incoming)

用法

1.引入detect.js文件
2.引入需要的组件
3.运行
  	DETECT.init();

4.得到全局对象DETECT.INFO

DETECT.INFO包含如下信息:

  INFO = {
		network: {
			brandwidth:-1,
			type:'',
			grade:''
		},
		ua: {
			plat: {
				name:'',
				version:''
			},
			device: {
				name:'',
				version:''
			},
			browser: {
				name:'',
				version:'',
				webkitversion:''
			}
		},
		ability: {},
		hardware: {
			resolution: [],
			performance: ''
		},
		api: {}
	};

5.取得某一个你想要的信息:

var info = DETECT.INFO.network.type //'WIFI'

detect.js's People

Contributors

smbey0nd avatar terrykingcha avatar

Watchers

James Cloos avatar 袁佳坤 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.