获取地址栏及参数

    getUrlArgObject(){ 
        var me=this;
        var args=new Object(); 
        var query=location.search.substring(1);//获取查询串 
        var pairs=query.split(",");//在逗号处断开 
        for(var i=0;i

Object.keys

返回一个所有元素为字符串的数组

案例:

// simple array
var arr = ['a', 'b', 'c'];
console.log(Object.keys(arr)); // console: ['0', '1', '2']

// array like object
var obj = { 0: 'a', 1: 'b', 2: 'c' };
console.log(Object.keys(obj)); // console: ['0', '1', '2']

// array like object with random key ordering
var anObj = { 100: 'a', 2: 'b', 7: 'c' };
console.log(Object.keys(anObj)); // console: ['2', '7', '100']

// getFoo is a property which isn't enumerable
var myObj = Object.create({}, {
  getFoo: {
    value: function () { return this.foo; }
  } 
});
myObj.foo = 1;
console.log(Object.keys(myObj)); // console: ['foo']

你可能感兴趣的:(jquery,es5)