API
Class

Network ($UI/system/api/native/network)

使用范围:UI2

Contents

class Network ($UI/system/api/native/network)

网络信息。

 
	 
	 	var network = require('$UI/system/api/native/network');
	        network.getNetworkType({
		  success : function(res) {
			alert(res.networkType);
		  },
		  fail : function(res) {
			alert(JSON.stringify(res));
		}
	});
	

Constructor Top

  Network ()

Static Methods Top

void getNetworkType (Object options)

Constructor details Top

public Network ()

网络信息。

 
	 
	 	var network = require('$UI/system/api/native/network');
	        network.getNetworkType({
		  success : function(res) {
			alert(res.networkType);
		  },
		  fail : function(res) {
			alert(JSON.stringify(res));
		}
	});
	

Static Methods Detail Top

static public void getNetworkType (Object options)

得到当前的网络类型

Parameters

Object options

选项
结构如下:

{ "success" : {function} success 回调函数 "fail" : {function} fail 回调函数 }

Return Value

void