了不起的nodejs算是一本不错的入门书,不过书中个别案例存在bug,按照书中源码无法做出和书中相同效果,原本兴奋的心情掺杂着些许失落。 现在我们看一下第七章HTTP,一个Twitter Web客户端的例子。 先贴上书中源码 1.创建server.js 1 var qs = require('que ...
分类:
Web程序 时间:
2017-08-23 11:50:59
阅读次数:
223
一、JSON.parse(用于从一个字符串中解析出json 对象)ps:单引号写在{}外,每个属性都必须双引号,否则会抛出异常 let str = '[{"field":"thedate","v1":"20170102"},{"field":"rev_type","v1":"大数据收入"},{"fi ...
分类:
Web程序 时间:
2017-08-10 19:35:28
阅读次数:
149
const qs =require('querystring'); var str="uname=tom&upwd=123&pno=33&kw=js;" //查询字符串转成对象 var obj=qs.parse(str); console.log(obj) // 输出JS对象{uname:'tom' ...
分类:
其他好文 时间:
2017-08-10 10:11:39
阅读次数:
134
Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that ...
分类:
其他好文 时间:
2017-08-09 12:53:29
阅读次数:
175
QS Network ZOJ Problem Set - 1586 Sunny Cup 2003 - Preliminary Round April 20th, 12:00 - 17:00 Problem E: QS Network In the planet w-503 of galaxy cgb ...
分类:
Web程序 时间:
2017-08-02 19:57:41
阅读次数:
203
Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that ...
分类:
其他好文 时间:
2017-08-02 11:10:12
阅读次数:
165
/*** [getQueryStringArgs 用以解析查询字符串]* @return {[Object]} [一个包含所有参数的对象]*/function getQueryStringArgs(){ //取得查询字符串并去掉开头的“?” var qs = (location.search.len ...
分类:
编程语言 时间:
2017-07-27 12:45:29
阅读次数:
211
A Bug's Life Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description Background Professor Hopper is researching the sexual behavi ...
分类:
其他好文 时间:
2017-07-25 13:37:15
阅读次数:
139
Problem Description Professor Zhang has a number sequence a1,a2,...,an. However, the sequence is not complete and some elements are missing. Fortunate ...
分类:
其他好文 时间:
2017-07-24 10:10:09
阅读次数:
268
Problem Description Professor Zhang has kinds of characters and the quantity of the i-th character is ai. Professor Zhang wants to use all the charact ...
分类:
其他好文 时间:
2017-07-24 09:51:47
阅读次数:
128