Base64 encoding and decoding in JavaScript

JavaScript Notes

2019.11.30

Base64 encoding and decoding in JavaScript

Base64 encoding schemes are commonly used when there is a need to encode binary data that needs to be stored and transferred over media that are designed to deal with textual data. This is to ensure that the data remain intact without modification during transport.

The Continuation-Passing Style in JavaScript

JavaScript Notes

2018.12.21

The Continuation-Passing Style in JavaScript

In JavaScript, a callback is a function that is passed as an argument to another function and is invoked with the result when the operation completes. In functional programming, this way of propagating the result is called continuation-passing style (CPS). It simply indicates that a result is propagated by passing it to another function (the callback), instead of directly returning it to the caller.

Practising closures in JavaScript

JavaScript Notes

2018.12.17

Practising closures in JavaScript

JavaScript is a very function-oriented language. As we know, functions are first class objects and can be easily assigned to variables, passed as arguments, returned from another function invocation, or stored into data structures. A function can access variable outside of it. But what happens when an outer variable changes? Does a function get the most recent value or the one that existed when the function was created? Also, what happens when a function invoked in another place - does it get access to the outer variables of the new place?

JS 本地数据存储之 cookie

JavaScript Notes / Web Notes

2018.03.09

JS 本地数据存储之 cookie

本来只是想简单看看 cookie、localStorage 和 sessionStorage 的,没想到一搜索扩展了很多知识,但是,中心主题还是集中在 web storage (localStorage, sessionStorage) 的认识上,以及怎么使用它们。不过,在此之前,先来简单认识一下 cookie 吧。

Ads by Google
logout

宫中行乐词八首

李白「唐代」

小小生金屋,盈盈在紫微。

山花插宝髻,石竹绣罗衣。

每出深宫里,常随步辇归。

只愁歌舞散,化作彩云飞。

柳色黄金嫩,梨花白雪香。

玉楼巢翡翠,金殿锁鸳鸯。

选妓随雕辇,征歌出洞房。

宫中谁第一,飞燕在昭阳。

卢橘为秦树,蒲桃出汉宫。

烟花宜落日,丝管醉春风。

笛奏龙吟水,箫鸣凤下空。

君王多乐事,还与万方同。

玉树春归日,金宫乐事多。

后庭朝未入,轻辇夜相过。

笑出花间语,娇来竹下歌。

莫教明月去,留著醉嫦娥。

绣户香风暖,纱窗曙色新。

宫花争笑日,池草暗生春。

绿树闻歌鸟,青楼见舞人。

昭阳桃李月,罗绮自相亲。

今日明光里,还须结伴游。

春风开紫殿,天乐下朱楼。

艳舞全知巧,娇歌半欲羞。

更怜花月夜,宫女笑藏钩。

寒雪梅中尽,春风柳上归。

宫莺娇欲醉,檐燕语还飞。

迟日明歌席,新花艳舞衣。

晚来移彩仗,行乐泥光辉。

水绿南薰殿,花红北阙楼。

莺歌闻太液,凤吹绕瀛洲。

素女鸣珠佩,天人弄彩球。

今朝风日好,宜入未央游。