星*空

Live beautifully,Dream passionately,Love completely


  • 首页

  • 标签

  • 分类

  • 归档

async函数

发表于 2018-11-26

1.async函数基本用法

async函数返回一个promise对象;可以使用then方法添加回调函数。当函数执行的时候,遇到await就先返回,等异步操作完成,再接着执行函数体后面的语句。例子如下:

async function getStockByName(name) {
    const symbol = await getStockSymbol(name);
    const stockPrice = await getStockPrice(symbol)
    return stcokPrice;
}
getStockByName('gogle').then(function(result) {
    console.log(result)
})

阅读全文 »

了解一下jQuery.ajaxPrefilter()

发表于 2018-11-20 | 分类于 Javascript

1. jQuery.ajaxPrefilter([dataTypes],handler)

jquery的官网文档给出的api方法描述:
Description: Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().

阅读全文 »

动态加载js文件

发表于 2018-11-15 | 分类于 Javascript

在某些复杂的项目中我们需要适配多个平台或者渠道,因此需要引入不同平台的js通用文件。所以我们需要根据不同的平台环境判断引入不同的js文件,此时就需要我们掌握动态加载js文件的常用方法以及遇到的常见问题。这里总结几种常用方法和各自的优缺点。

阅读全文 »

我的第一个博客第一篇博文

发表于 2018-05-31

第一次搭建的博客,使用github和hexo很简单,省去了使用服务器和后台编程的烦恼,给自己一个空间去记录发生的点点滴滴,当然还是以工作项目记录为主,为自己在工作中遇到的问题做个笔记,希望自己能一点点成长。将博客命名为星空也是希望自己虽然平凡如繁星中的一颗,但还是会努力去发光,努力去耀眼,努力去让你看见。我也坚信离开人世的爸爸就在那耀眼的星空中看着我。

阅读全文 »

Hello World

发表于 2018-05-24

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

1…34
Liucheng

Liucheng

记录点点滴滴的进步

35 日志
5 分类
11 标签
0%
© 2021 Liucheng
本站访客数 人次 本站总访问量 次