https://juejin.im/post/5b0903b26fb9a07a9d70c7e0[

js 数组详细操作方法及解析合集

js array and for each

https://blog.csdn.net/zdhsoft/article/details/54017183

http://www.cnblogs.com/qiantuwuliang/archive/2011/01/08/1930499.html

var domain = 'https://testu.unipus.cn';


var url =
'/api/v1/schedule_strategy_setting/updateStrategy?strategyDbId=';
var a = [101, 102,103];
var callUrl = domain + url;
for ( i in a){
   callUrl + i;

}

// 首先定义一个json对象,对象以“{”(左括号)开始,“}”(右括号)结束
// 花括号内为键、值对 键必须用引号括起来,值若不是字符串则不必
var stocks = {
"创维电视" : 50,
"卡萨帝北京" : 40,
"家电" : 40,
"松下" : 30,
"格力" : 20,
"海尔" : 20,
"海尔商城" : 20,
"海尔客服" : 20,
"美的" : 20,
"美菱" : 20
}

for
(var symbol in stocks) {console.log(stocks[symbol])}

for (var key in stocks) {console.log(stocks[key])}

Chrome 42 或更新的版本支持 Fetch API 了, F12 打开 Console :
> fetch(new
Request('///foo.com/bar',{method:'POST'})).then((resp)=>{console.log(resp)})

fetch(new Request('https://trialucampus.unipus.cn/admin/educlass/startStatus?eId=1098&school_id=6',{method:'GET'})).then((resp)=>{console.log(resp)})

$.ajax({
    url: 'https://trialucampus.unipus.cn/admin/educlass/startStatus?eId=1098&school_id=6',
    type: 'GET',
    success: function(data) {
        console.log('success!');
    },
    error: function(data) {
        console.log('error');
    }
})

$.ajax({
    url: 'https://trialucampus.unipus.cn/admin/educlass/stopStatus?eId=1098&school_id=6',
    type: 'GET',
    success: function(data) {
        console.log('success stop!');
    },
    error: function(data) {
        console.log('error stop');
    }
})

var array = [1,2,3]
for (var i = 0; i < array.length; i) { 
    console.log(i,array[i]); 
}

var array=[1565,
1566]
array.forEach(v=>{
console.log(v);
$.ajax({
url: 'https://trialucampus.unipus.cn/admin/educlass/stopStatus?eId='+v+'&school_id=6',
type: 'GET',
success: function(data) {
console.log('success stop!');
},
error: function(data) {
console.log('error stop');
}
})
});
  1. Request URL:
  2. Request Method:
    GET

      Request URL:https://trialucampus.unipus.cn/admin/educlass/startStatus?eId=1098&school_id=6
Request Method:GET Request URL:https://trialucampus.unipus.cn/admin/educlass/stopStatus?eId=1098&school_id=6
Request Method:GET

post/get in console of JSarray/js 数组详细操作方法及解析合集的更多相关文章

  1. 11、js 数组详细操作方法及解析合集

    js 数组详细操作方法及解析合集 前言 在开发中,数组的使用场景非常多,平日中也涉及到很多数组的api/相关操作,一直也没有对这块内容进行一块整理总结,很多时候就算用过几次这个api,在开发中也很容易 ...

  2. javascript: 数组详细操作方法及解析合集(9个改变8个不变12个遍历)

    改变原数组的方法(9个): 1 2 3 4 5 let a = [1,2,3]; ES5: a.pop()/ a.shift()/ a.push()/ a.unshift()/ a.reverse() ...

  3. js数组常用操作方法小结(增加,删除,合并,分割等)

    本文实例总结了js数组常用操作方法.分享给大家供大家参考,具体如下: var arr = [1, 2, 3, 4, 5]; //删除并返回数组中第一个元素 var theFirst = arr.shi ...

  4. JS数组的操作方法汇总

    数组的增删 push():添加到最后 pop():取出最后一个 shift():取出第一个 unshift():添加到第一个 splice() : 返回删除的数组,如果没有则为空数组,会改变原数组.可 ...

  5. js数组的操作方法

    es5中新添加的方法比如map,reduce之类的

  6. 原生JS中DOM节点相关API合集

    节点属性 Node.nodeName //返回节点名称,只读 Node.nodeType //返回节点类型的常数值,只读 Node.nodeValue //返回Text或Comment节点的文本值,只 ...

  7. js漂浮广告实现代码(合集经典)

    <html> <head> <title>漂浮广告</title> <body> <div id="codefans_net ...

  8. 页面循环绑定(变量污染问题),js面向对象编程(对象属性增删改查),js字符串操作,js数组操作

    页面循环绑定(变量污染问题) var lis = document.querySelectorAll(".ul li") for ( var i = 0 ; i < lis. ...

  9. js array数组对象操作方法汇总

    --------------------------更新自2018.6.11 js 数组对象操作方法如下: 1. 创建数组 var array1 = [1,2] //方法一 var array2 = ...

随机推荐

  1. [Big Data - ZooKeeper] ZooKeeper: A Distributed Coordination Service for Distributed Applications

    ZooKeeper ZooKeeper: A Distributed Coordination Service for Distributed Applications Design Goals Da ...

  2. vue使用node的入门

    1.安装cnpm npm install -g cnpm --registry=https://registry.npm.taobao.org 验证是否安装 cnpm -v 2.安装vue cnpm ...

  3. vue手写的轮播图片,解决已经修改data中的值,页面标签已绑定,但页面没效果

    1.效果 2.index.html <!DOCTYPE html> <html lang="en"> <link> <meta chars ...

  4. 【转】Django中使用POST方法获取POST数据

    1.获取POST中表单键值数据 如果要在django的POST方法中获取表单数据,则在客户端使用JavaScript发送POST数据前,定义post请求头中的请求数据类型: xmlhttp.setRe ...

  5. 小技巧 - CSS中:hover调试

    在调试CSS的时候,我一般使用Chrome的F12开发者工具,或者FireFox的FireBug直接在元素上面修改好Style后,再写入到CSS中.前几天遇到一个问题就是a:hover,鼠标一移开效果 ...

  6. oneinstack 另一个 lnmp环境一键安装工具

    oneinstack  另一个 http://oneinstack.com/ OneinStack包含以下组合: lnmp(Linux + Nginx+ MySQL+ PHP) lamp(Linux ...

  7. Ubuntu 中的VI和vim

    转载出处:http://blog.csdn.net/xiajun07061225/article/details/7039413 或功能键[Home]:移动到这一行的最前面字符处. $或功能键[End ...

  8. rqalpha探究 2 接入mod

    程序的目的是尽可能用mod扩展功能,所以接下来需要接入mod模块

  9. Ubuntu16.04安装xgboost

    1.Python下安装方法 git clone --recursive https://github.com/dmlc/xgboost cd xgboost make -j4 cd python-pa ...

  10. 在Android Studio中查看Sqlite的方法

    只说最好的方法,使用工具stetho:http://facebook.github.io/stetho/ 1.在Gragle中加上如下语句: dependencies { // Stetho core ...