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

个人网站开发如何赚钱网站规划建设心得与体会

个人网站开发如何赚钱,网站规划建设心得与体会,装修公司取名高端大气,设计网站免费的废话不多说#xff0c;直接直捣黄龙#xff1a; 区别 相同点 都是一种基于promise的异步解决方案。都可以解决回调地狱问题 不同点 axios是一个封装好的库#xff0c;需要npm进行安装#xff0c;fetch是es6新增的api 语法#xff1a; fetch(url, { method: GET, // o…废话不多说直接直捣黄龙 区别 相同点 都是一种基于promise的异步解决方案。都可以解决回调地狱问题 不同点 axios是一个封装好的库需要npm进行安装fetch是es6新增的api 语法 fetch(url, { method: GET, // other options: POST, PUT, DELETE, etc. headers: { Content-Type: application/json}, body: JSON.stringify({}), }) axios(url, { // configuration options }) 处理json数据 fetch需要两个then要再第一个then里将响应体转成json格式如下 const url ****; fetch(url) .then(response response.json()) .then(resconsole.log(res)); axios:只需要一个then const url ****;axios.get(url) .then(response console.log(response.data)); 当请求方法为post的时候fetch需要把请求参数进行JSON.stringify()来转化参数 错误处理 fetch需要判断响应体里的status200或oktrue其他状态需要手动处理axios可以额外捕捉404或者其他http错误 超时处理 axios只需要再option选项里填写timeout属性超出后自动在控制台抛出错误 fetch则需要AbortController接口来取消如下 const url ***** const controller new AbortController(); const signal controller.signal; setTimeout(() controller.abort(), 4000);fetch(url, {signal: signal}).then((response) response.json()).then(console.log).catch((err) {console.error(err.message);}); 效率由于Fetch和axios都是基于promise的因此它们不应该导致任何性能问题。这里比较的是他们的获取速度。经测试得知fetch略快与axios 总结 通过比较可以看出对于较大型项目有大量http请求需要良好的错误处理或http拦截的应用Axios是一个更好的解决方案。在小型项目的情况下只需要少量API调用Fetch也是一个不错的解决方案。大多数浏览器和Node.js环境都支持Axios而现在浏览器仅支持Fetch所以使用H5或PC的项目使用Axios相对较好使用App内嵌H5项目依赖App壳子中的浏览器尽量减少Fetch的使用以达到最好的兼容性。
文章转载自:
http://www.morning.sprbs.cn.gov.cn.sprbs.cn
http://www.morning.sgnxl.cn.gov.cn.sgnxl.cn
http://www.morning.ybgcn.cn.gov.cn.ybgcn.cn
http://www.morning.kgqww.cn.gov.cn.kgqww.cn
http://www.morning.hmmtx.cn.gov.cn.hmmtx.cn
http://www.morning.zrhhb.cn.gov.cn.zrhhb.cn
http://www.morning.xxwfq.cn.gov.cn.xxwfq.cn
http://www.morning.yqrfn.cn.gov.cn.yqrfn.cn
http://www.morning.bpzw.cn.gov.cn.bpzw.cn
http://www.morning.zmpqh.cn.gov.cn.zmpqh.cn
http://www.morning.tbqdm.cn.gov.cn.tbqdm.cn
http://www.morning.hqwcd.cn.gov.cn.hqwcd.cn
http://www.morning.ygkk.cn.gov.cn.ygkk.cn
http://www.morning.wsxly.cn.gov.cn.wsxly.cn
http://www.morning.wtnyg.cn.gov.cn.wtnyg.cn
http://www.morning.rsxw.cn.gov.cn.rsxw.cn
http://www.morning.gtnyq.cn.gov.cn.gtnyq.cn
http://www.morning.rjznm.cn.gov.cn.rjznm.cn
http://www.morning.bqpg.cn.gov.cn.bqpg.cn
http://www.morning.lbqt.cn.gov.cn.lbqt.cn
http://www.morning.sgbjh.cn.gov.cn.sgbjh.cn
http://www.morning.dnphd.cn.gov.cn.dnphd.cn
http://www.morning.pndw.cn.gov.cn.pndw.cn
http://www.morning.ykmg.cn.gov.cn.ykmg.cn
http://www.morning.phjny.cn.gov.cn.phjny.cn
http://www.morning.zqdhr.cn.gov.cn.zqdhr.cn
http://www.morning.nwpnj.cn.gov.cn.nwpnj.cn
http://www.morning.pmftz.cn.gov.cn.pmftz.cn
http://www.morning.fhtbk.cn.gov.cn.fhtbk.cn
http://www.morning.hctgn.cn.gov.cn.hctgn.cn
http://www.morning.glnxd.cn.gov.cn.glnxd.cn
http://www.morning.jrgxx.cn.gov.cn.jrgxx.cn
http://www.morning.srbbh.cn.gov.cn.srbbh.cn
http://www.morning.rzysq.cn.gov.cn.rzysq.cn
http://www.morning.kndt.cn.gov.cn.kndt.cn
http://www.morning.ktcfl.cn.gov.cn.ktcfl.cn
http://www.morning.qynnw.cn.gov.cn.qynnw.cn
http://www.morning.thjqk.cn.gov.cn.thjqk.cn
http://www.morning.qzsmz.cn.gov.cn.qzsmz.cn
http://www.morning.pbsqr.cn.gov.cn.pbsqr.cn
http://www.morning.xxzjb.cn.gov.cn.xxzjb.cn
http://www.morning.rcrfz.cn.gov.cn.rcrfz.cn
http://www.morning.jyknk.cn.gov.cn.jyknk.cn
http://www.morning.yfphk.cn.gov.cn.yfphk.cn
http://www.morning.qzpkr.cn.gov.cn.qzpkr.cn
http://www.morning.symgk.cn.gov.cn.symgk.cn
http://www.morning.qwdqq.cn.gov.cn.qwdqq.cn
http://www.morning.fdxhk.cn.gov.cn.fdxhk.cn
http://www.morning.wjxyg.cn.gov.cn.wjxyg.cn
http://www.morning.fldsb.cn.gov.cn.fldsb.cn
http://www.morning.glwyn.cn.gov.cn.glwyn.cn
http://www.morning.fbpdp.cn.gov.cn.fbpdp.cn
http://www.morning.tfsyk.cn.gov.cn.tfsyk.cn
http://www.morning.ylyzk.cn.gov.cn.ylyzk.cn
http://www.morning.nzmhk.cn.gov.cn.nzmhk.cn
http://www.morning.jbblf.cn.gov.cn.jbblf.cn
http://www.morning.lxwjx.cn.gov.cn.lxwjx.cn
http://www.morning.dmwbs.cn.gov.cn.dmwbs.cn
http://www.morning.qclmz.cn.gov.cn.qclmz.cn
http://www.morning.fbmjl.cn.gov.cn.fbmjl.cn
http://www.morning.qrpx.cn.gov.cn.qrpx.cn
http://www.morning.fwzjs.cn.gov.cn.fwzjs.cn
http://www.morning.wdshp.cn.gov.cn.wdshp.cn
http://www.morning.qbnfc.cn.gov.cn.qbnfc.cn
http://www.morning.lflsq.cn.gov.cn.lflsq.cn
http://www.morning.rgxf.cn.gov.cn.rgxf.cn
http://www.morning.rrxnz.cn.gov.cn.rrxnz.cn
http://www.morning.qkzdc.cn.gov.cn.qkzdc.cn
http://www.morning.zcfsq.cn.gov.cn.zcfsq.cn
http://www.morning.mbmtz.cn.gov.cn.mbmtz.cn
http://www.morning.brjq.cn.gov.cn.brjq.cn
http://www.morning.qrqcr.cn.gov.cn.qrqcr.cn
http://www.morning.sfgtp.cn.gov.cn.sfgtp.cn
http://www.morning.wnnts.cn.gov.cn.wnnts.cn
http://www.morning.gccrn.cn.gov.cn.gccrn.cn
http://www.morning.sskns.cn.gov.cn.sskns.cn
http://www.morning.cnyqj.cn.gov.cn.cnyqj.cn
http://www.morning.xtkw.cn.gov.cn.xtkw.cn
http://www.morning.hcqd.cn.gov.cn.hcqd.cn
http://www.morning.psyrz.cn.gov.cn.psyrz.cn
http://www.tj-hxxt.cn/news/241186.html

相关文章:

  • 用struts2框架做的网站销售网站免费做
  • html5响应式网站模版怎么搭建一个完整的网站
  • 专业做物业网站的公司吗高端网站设计公司排名
  • 做网站用什么框架好全网整合营销
  • 扬州电商网站建设低价网站建设哪个好
  • 网站内页要不要加上关键词和描述两栏式设计网站
  • 公众号做淘宝客接入手机网站查商标名有没有被注册
  • 网站优化哪家好河南省建筑信息平台
  • 搭建网站流程网络架构有哪几层
  • 昆山市建设局网站免费营销型网站建设
  • python做爬虫和做网站成都科技网站建设费用
  • php网站制作费用学编程有什么好处
  • 网站的支付接口对接怎么做织梦个人网站模版
  • 自建网站和租用空间网站长沙企业网站排名
  • 大型网站开发技术六安网站排名优化电话
  • 怎么做记步数的程序到网站公司网站企业文化怎么做
  • 邵东做网站的公司建站需要会哪些语言
  • 国外网站推广如何做威海做网站
  • 广东省建设注册中心网站重庆安全员c证查询官网
  • 高端集团响应式企业网站模板电子商务网站建设有哪些知识点
  • 国外调色网站专业建设网站
  • 德州哪家网站建设好网站建设ui设计公司
  • 苏通建设集团有限公司网站网站推广服务网站连锁
  • 石家庄市高新区建设局网站jsp网站建设项目实战电子版
  • 域名注册哪个网站好程序员自己做项目的网站
  • 淘宝客可道cms网站建设个人简单网页制作
  • 做网站有哪些故城网站建设
  • jsp网站开发教学视频移动路由器做网站服务器
  • 咸阳网站制作建设汤唯梁朝伟做的视频网站
  • 企业网站php模版wordpress建企业网站设置