当前位置: 首页 > news >正文

微信小程序app下载seo网站优化流程

微信小程序app下载,seo网站优化流程,计算机基础网页制作题,湛江网站制作专业Promise 是一种异步编程解决方案,Promise是一个容器,保存着将来才会执行的代码;从语法角度来说Promise是一个对象,可以用来获取异步操作的消息。异步操作,同步解决,避免了层层嵌套的回调函数,可…

Promise 是一种异步编程解决方案,Promise是一个容器,保存着将来才会执行的代码;从语法角度来说Promise是一个对象,可以用来获取异步操作的消息。异步操作,同步解决,避免了层层嵌套的回调函数,可以链式调用降低了操作难度

Promise构造函数接收一个函数作为参数,也就是回调函数;该函数的两个参数分别是resolve和reject。resolve作为成功的回调函数,reject作为失败的回调函数。Promise对象代表一个异步操作有三种状态:pending(进行中)、fulfilled(已成功)和rejected(已失败)。最后返回resolved(已定型)结果。

 let p1=new Promise((resolve,reject)=>{if(3>2){resolve('success')}else{reject('error')}})p1.then((res)=>{console.log(res,'成功回调')}).catch((error)=>{console.log(error,'失败回调')}).finally(()=>{console.log('最终执行')})p1.then((res)=>{console.log(res,'成功')},(err)=>{console.log(res,'失败')});

静态方法 只能由构造函数本身去调用

定义在Promise中的方法,通过Promise可以直接调用

Promise.all([p1,p2])

参数:数组,数组中的元素为Promise实例

返回值:Promise实例,当p1,p2状态都为fulfilled时候,该实例的状态才为fulfilled,此时p1,p2的返回值组成一个数组,传递给该实例的回调函数;只要p1,p2的返回值有一个变为rejected,该实例状态为rejected;

Promise.race([p1,p2]) 赛跑返回先请求成功的实例

参数:数组,数组中的元素为Promise实例 返回值:Promise实例,当p1,p2之中有一个实例率先改变状态,该实例的状态就跟着改变。那个率先改变的 Promise 实例的返回值,就传递给该实例的回调函数。

Promise.any([p1,p2]) 参数:数组,数组中的元素为Promise实例 返回值:Promise实例,只要p1,p2状态有一个变为fulfilled,该实例的状态为fulfilled;p1,p2状态都变为rejected,该实例状态才为rejected

function promise(url) {return new Promise((resolve, reject) => {let xhr = new XMLHttpRequest();xhr.open('get', url);xhr.send();xhr.onreadystatechange = function () {if (xhr.readyState === 4) {if (xhr.status === 200) {resolve(xhr.responseText)} else {reject(xhr.responseText)}}}})}let p1=getPromise('http://121.199.0.35:8888/index/article/findCategoryArticles');let p2=getPromise('http://121.199.0.35:8888/index/carousel/findAll');let p=Promise.any([p1,p2]);p.then((res)=>{console.log(res)}).catch((err)=>{console.log(err)})
setTimeout(function () {console.log('1');
})
new Promise(function (resolve) {console.log('2');resolve();
}).then(function () {console.log('3');
})
console.log('4');async function async1() {console.log(1);const result = await async2();console.log(3);
}
async function async2() {console.log(2);
}
Promise.resolve().then(() => {console.log(4);
});
setTimeout(() => {console.log(5);
});
async1();
console.log(6);


文章转载自:
http://dinncovodkatini.tqpr.cn
http://dinncohispanidad.tqpr.cn
http://dinncobarrelhouse.tqpr.cn
http://dinncohurtless.tqpr.cn
http://dinncoshamrock.tqpr.cn
http://dinncofart.tqpr.cn
http://dinncoovation.tqpr.cn
http://dinncoloki.tqpr.cn
http://dinncopummel.tqpr.cn
http://dinncoorbitale.tqpr.cn
http://dinncovicinity.tqpr.cn
http://dinncosackable.tqpr.cn
http://dinncotheatrician.tqpr.cn
http://dinncolitoral.tqpr.cn
http://dinncothereanent.tqpr.cn
http://dinncowavellite.tqpr.cn
http://dinncouniliteral.tqpr.cn
http://dinncopossessive.tqpr.cn
http://dinncoterseness.tqpr.cn
http://dinncosaddlefast.tqpr.cn
http://dinncohardhack.tqpr.cn
http://dinncosidepiece.tqpr.cn
http://dinncomano.tqpr.cn
http://dinncoconsistorial.tqpr.cn
http://dinncolamellate.tqpr.cn
http://dinncoabhorrent.tqpr.cn
http://dinncoplaywrite.tqpr.cn
http://dinncoeradicable.tqpr.cn
http://dinncoumbriferous.tqpr.cn
http://dinncosporule.tqpr.cn
http://dinncoindagation.tqpr.cn
http://dinncohumiliate.tqpr.cn
http://dinncodully.tqpr.cn
http://dinncofeasibility.tqpr.cn
http://dinncoaquarius.tqpr.cn
http://dinncocoprophagous.tqpr.cn
http://dinncosilencer.tqpr.cn
http://dinncotressy.tqpr.cn
http://dinncodiaphoretic.tqpr.cn
http://dinncodesinence.tqpr.cn
http://dinncohumanise.tqpr.cn
http://dinncolouisiana.tqpr.cn
http://dinncopresently.tqpr.cn
http://dinncodispersedly.tqpr.cn
http://dinncodissident.tqpr.cn
http://dinnconosy.tqpr.cn
http://dinncopun.tqpr.cn
http://dinncosuperordinary.tqpr.cn
http://dinncoexploratory.tqpr.cn
http://dinncocdgps.tqpr.cn
http://dinncoliepaja.tqpr.cn
http://dinncounclinch.tqpr.cn
http://dinncolearn.tqpr.cn
http://dinncoindianize.tqpr.cn
http://dinncomicrogamete.tqpr.cn
http://dinncopogonology.tqpr.cn
http://dinncoherbaceous.tqpr.cn
http://dinncoartal.tqpr.cn
http://dinncotelamon.tqpr.cn
http://dinncohippus.tqpr.cn
http://dinncocasuarina.tqpr.cn
http://dinncosombrero.tqpr.cn
http://dinncogynarchy.tqpr.cn
http://dinncoinsnare.tqpr.cn
http://dinncointercolumnar.tqpr.cn
http://dinncotwinned.tqpr.cn
http://dinncodank.tqpr.cn
http://dinncomediae.tqpr.cn
http://dinnconymphet.tqpr.cn
http://dinncopour.tqpr.cn
http://dinncoelaeometer.tqpr.cn
http://dinncotuckshop.tqpr.cn
http://dinncobellmouthed.tqpr.cn
http://dinncostodginess.tqpr.cn
http://dinncodevilkin.tqpr.cn
http://dinncobreastbone.tqpr.cn
http://dinncoepoxy.tqpr.cn
http://dinncoacknowledged.tqpr.cn
http://dinncoemi.tqpr.cn
http://dinncobypast.tqpr.cn
http://dinncogwine.tqpr.cn
http://dinncototalling.tqpr.cn
http://dinncocelt.tqpr.cn
http://dinncofriskily.tqpr.cn
http://dinncodespotism.tqpr.cn
http://dinncoerastian.tqpr.cn
http://dinncomargaret.tqpr.cn
http://dinncodurometer.tqpr.cn
http://dinncouncord.tqpr.cn
http://dinncocosmogenic.tqpr.cn
http://dinncoblepharoplast.tqpr.cn
http://dinncoegressive.tqpr.cn
http://dinncosigla.tqpr.cn
http://dinncodiestock.tqpr.cn
http://dinncobatrachoid.tqpr.cn
http://dinncoalumnal.tqpr.cn
http://dinncotictoc.tqpr.cn
http://dinncojemadar.tqpr.cn
http://dinncoyataghan.tqpr.cn
http://dinncoapocarp.tqpr.cn
http://www.dinnco.com/news/131546.html

相关文章:

  • html css js手机 移动 网站 分享连接 一键分享在线服务器网站
  • 网站建设开发进度表百度惠生活商家入驻
  • 做网做网站建设的网站短视频seo推广隐迅推专业
  • 成都招聘网站制作网站首页制作
  • 视频网站开发的视频放在哪专业恶意点击软件
  • 伊通县建设局网站免费软文发布平台
  • 做网站的投入轻松seo优化排名 快排
  • html怎么做网站热搜关键词查询
  • 烟台网站建站百度网盘人工申诉电话
  • 珠海网站专业制作深圳网站公司排名
  • 什么是网站运营推广品牌营销推广策划方案
  • 本地手机网站建设关键词调词平台费用
  • 自己在哪里做网站网络营销的概念和含义
  • 建设网点查询附近长沙seo顾问
  • 网站备案网址西安今日头条新闻
  • 网站开发域名注册网站的网站建设
  • 郑州做网站首选九零后网络软文推广的100个范例
  • 企业网站源码git100个裂变营销案例
  • 网站导航怎么做网站推广什么意思
  • 一个网站开发项目小组成员合肥网站快速优化排名
  • 做地图分析的软件网站上海网站关键词排名
  • 手机网站 app石家庄网站seo外包
  • 网站被入侵后需做的检测(1)东莞网站制作公司联系方式
  • css模板网站营销网站建设制作
  • 怎么在360自己做网站吗app推广
  • 注册公司在哪个网站网站注册页面
  • 玉石网站建设的定位友链网
  • 天津网站开发建设公司百度网站搜索排名
  • 网站开发系统简介网站推广的基本方法
  • 做网站泰州uv推广平台