码迷,mamicode.com
首页 > Web开发 > 详细

post/get in console of JSarray

时间:2018-06-23 13:21:33      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:F12   $.ajax   IV   link   name   children   dhs   child   http   

js array and for each

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



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

标签:F12   $.ajax   IV   link   name   children   dhs   child   http   

原文地址:https://www.cnblogs.com/SZLLQ2000/p/9216715.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!