post/get in console of JSarray
Posted szllq2000
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了post/get in console of JSarray相关的知识,希望对你有一定的参考价值。
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‘); } }) });
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 各种循环的区别与用法(for in,forEach,for of)