-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
1326 lines (866 loc) · 155 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<link rel="dns-prefetch" href="http://yoursite.com">
<title>不存在的……</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="工作学习笔记">
<meta property="og:type" content="website">
<meta property="og:title" content="不存在的……">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="不存在的……">
<meta property="og:description" content="工作学习笔记">
<meta property="og:locale" content="zh-Hans">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="不存在的……">
<meta name="twitter:description" content="工作学习笔记">
<link rel="alternative" href="/atom.xml" title="不存在的……" type="application/atom+xml">
<link rel="icon" href="/favicon.png">
<link rel="stylesheet" type="text/css" href="/./main.507b3a.css">
<style type="text/css">
#container.show {
background: linear-gradient(200deg,#a0cfe4,#e8c37e);
}
</style>
</head>
<body>
<div id="container" q-class="show:isCtnShow">
<canvas id="anm-canvas" class="anm-canvas"></canvas>
<div class="left-col" q-class="show:isShow">
<div class="overlay" style="background: #fff"></div>
<div class="intrude-less">
<header id="header" class="inner">
<a href="" class="profilepic">
<img src="https://qinghuanhehuan.github.io/headpicture/headpic.jpg" class="js-avatar">
</a>
<hgroup>
<h1 class="header-author"><a href="">清欢何欢</a></h1>
</hgroup>
<p class="header-subtitle">每一天都很好啊!</p>
<nav class="header-menu">
<ul>
<li><a href="/">主页</a></li>
<li><a href="/tags/随笔/">随笔</a></li>
</ul>
</nav>
<nav class="header-smart-menu">
<a q-on="click: openSlider(e, 'innerArchive')" href="javascript:void(0)">所有文章</a>
<a q-on="click: openSlider(e, 'aboutme')" href="javascript:void(0)">关于我</a>
</nav>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/Qinghuanhehuan" title="github"><i class="icon-github"></i></a>
</div>
</nav>
</header>
</div>
</div>
<div class="mid-col" q-class="show:isShow,hide:isShow|isFalse">
<nav id="mobile-nav">
<div class="overlay js-overlay" style="background: #fff"></div>
<div class="btnctn js-mobile-btnctn">
<div class="slider-trigger list" q-on="click: openSlider(e)"><i class="icon icon-sort"></i></div>
</div>
<div class="intrude-less">
<header id="header" class="inner">
<div class="profilepic">
<img src="https://qinghuanhehuan.github.io/headpicture/headpic.jpg" class="js-avatar">
</div>
<hgroup>
<h1 class="header-author js-header-author">清欢何欢</h1>
</hgroup>
<p class="header-subtitle"><i class="icon icon-quo-left"></i>每一天都很好啊!<i class="icon icon-quo-right"></i></p>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/Qinghuanhehuan" title="github"><i class="icon-github"></i></a>
</div>
</nav>
<nav class="header-menu js-header-menu">
<ul style="width: 50%">
<li style="width: 50%"><a href="/">主页</a></li>
<li style="width: 50%"><a href="/tags/随笔/">随笔</a></li>
</ul>
</nav>
</header>
</div>
<div class="mobile-mask" style="display:none" q-show="isShow"></div>
</nav>
<div id="wrapper" class="body-wrap">
<div class="menu-l">
<div class="canvas-wrap">
<canvas data-colors="#eaeaea" data-sectionHeight="100" data-contentId="js-content" id="myCanvas1" class="anm-canvas"></canvas>
</div>
<div id="js-content" class="content-ll">
<article id="post-文件拓展名截取、选取今天是周几写法" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2018/05/28/文件拓展名截取、选取今天是周几写法/">文件拓展名截取、选取今天是周几写法</a>
</h1>
<a href="/2018/05/28/文件拓展名截取、选取今天是周几写法/" class="archive-article-date">
<time datetime="2018-05-28T05:39:50.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2018-05-28</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h3 id="文件拓展名截取"><a href="#文件拓展名截取" class="headerlink" title="文件拓展名截取"></a>文件拓展名截取</h3><h4 id="之前的方案"><a href="#之前的方案" class="headerlink" title="之前的方案"></a>之前的方案</h4><pre><code class="JavaScript"><span class="keyword">const</span> extname = <span class="function">(<span class="params">filename</span>) =></span> {
<span class="keyword">let</span> arr = filename.split(<span class="string">"."</span>);
<span class="keyword">let</span> len = arr.length;
<span class="keyword">let</span> extname=<span class="string">''</span>
<span class="keyword">if</span>(len > <span class="number">1</span>){
extname = arr[len<span class="number">-1</span>];
extname = arr[len<span class="number">-2</span>]==<span class="string">''</span>?<span class="string">''</span>: <span class="string">`.<span class="subst">${extname}</span>`</span>;
<span class="keyword">return</span> extname
}
<span class="keyword">return</span> extname
}
</code></pre>
<h4 id="改进后的方案:增加几种情况"><a href="#改进后的方案:增加几种情况" class="headerlink" title="改进后的方案:增加几种情况"></a>改进后的方案:增加几种情况</h4><ol>
<li>点后无后缀</li>
<li>无点</li>
<li>有点,前面无文件名</li>
</ol>
<pre><code class="JavaScript"><span class="keyword">const</span> extname2 = <span class="function">(<span class="params">filename</span>) =></span> {
<span class="keyword">let</span> index = filename.lastIndexOf(<span class="string">"."</span>);
<span class="keyword">let</span> len = filename.length
<span class="keyword">if</span>(index <= <span class="number">0</span>||index == len<span class="number">-1</span>){
<span class="keyword">return</span> <span class="string">''</span>
}<span class="keyword">else</span>{
<span class="keyword">return</span> filename.substring(index,len)
}
}
</code></pre>
<a class="article-more-a" href="/2018/05/28/文件拓展名截取、选取今天是周几写法/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">js优化</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2018/05/28/文件拓展名截取、选取今天是周几写法/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-ES6总结(二)" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2018/05/25/ES6总结(二)/">ES6总结(二)</a>
</h1>
<a href="/2018/05/25/ES6总结(二)/" class="archive-article-date">
<time datetime="2018-05-25T02:28:50.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2018-05-25</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color4">ES6</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2018/05/25/ES6总结(二)/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-ES6总结(一)" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2018/05/24/ES6总结(一)/">ES6总结(一)</a>
</h1>
<a href="/2018/05/24/ES6总结(一)/" class="archive-article-date">
<time datetime="2018-05-24T02:28:43.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2018-05-24</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>这篇是个人总结的ES6用法,可能是不全面,但项目开发中用到的ES6语法基本都有。</p>
<h3 id="let和const命令"><a href="#let和const命令" class="headerlink" title="let和const命令"></a>let和const命令</h3><h4 id="作用域的概念"><a href="#作用域的概念" class="headerlink" title="作用域的概念"></a>作用域的概念</h4><p>ES5:全局作用域和函数作用域<br>ES6:块级作用域;严格模式</p>
<h4 id="如何使用let和const"><a href="#如何使用let和const" class="headerlink" title="如何使用let和const"></a>如何使用let和const</h4><ol>
<li>let声明的变量只在自己的作用域内有效;</li>
<li>let不能重复定义变量;</li>
<li>const声明一个常量,不能修改;</li>
<li>const声明的时候必须赋值;</li>
<li>const可以修改一个对象的数值,因为const保存的是对象的指针,并不保存对象本身;</li>
</ol>
<a class="article-more-a" href="/2018/05/24/ES6总结(一)/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color4">ES6</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2018/05/24/ES6总结(一)/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-技术人员如何规划职业道路" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2018/05/23/技术人员如何规划职业道路/">技术人员如何规划职业道路</a>
</h1>
<a href="/2018/05/23/技术人员如何规划职业道路/" class="archive-article-date">
<time datetime="2018-05-23T01:44:10.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2018-05-23</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="前言:"><a href="#前言:" class="headerlink" title="前言:"></a>前言:</h1><p> 前段时间在微信直播群里听到了前阿里钉钉技术总监、现准上市公司技术合伙人/副总裁武彻老师的技术分享:如何从小白成长为技术合伙人。刚听完觉得就是一些假大空的套话,将一些不痛不痒的理论并不能对实际开发做什么指导。<br>但是,这段时间我一直在想,既然是成功者的分享也是有一定的借鉴之处,只靠一场技术分享就能有很多收获或进步是不可能的,开发经验的累积和思考,一步步的积累才会有所进步。真正让人感到“痛苦”的成长,才会有收获。<br>下面是关于直播的一些分享:</p>
<h2 id="1-技术的价值"><a href="#1-技术的价值" class="headerlink" title="1.技术的价值"></a>1.技术的价值</h2><h3 id="先进生产力"><a href="#先进生产力" class="headerlink" title="先进生产力"></a>先进生产力</h3><p>一个公司技术团队的稳健是实现一切需求的基石,尤其需求在不同阶段对产品质量以及响应方面的高要求。</p>
<h3 id="实现需求三步曲"><a href="#实现需求三步曲" class="headerlink" title="实现需求三步曲"></a>实现需求三步曲</h3><ol>
<li>勉强做出来 </li>
<li>独挡一面 </li>
<li>成为tl</li>
</ol>
<a class="article-more-a" href="/2018/05/23/技术人员如何规划职业道路/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">分享</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2018/05/23/技术人员如何规划职业道路/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-TypeScipt入门" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2018/04/11/TypeScipt入门/">TypeScipt入门</a>
</h1>
<a href="/2018/04/11/TypeScipt入门/" class="archive-article-date">
<time datetime="2018-04-11T08:15:50.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2018-04-11</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="TypeScript是什么?"><a href="#TypeScript是什么?" class="headerlink" title="TypeScript是什么?"></a>TypeScript是什么?</h2><ol>
<li>TypeScript是由微软开发的自由和开源的编程语言。它是JavaScript的一个超集,而且本质上向这个语言添加了可选的静态类型和基于类的面向对象编程。</li>
<li>TypeScript 扩展了 JavaScript 的句法,所以任何现有的 JavaScript 程序可以不加改变的在 TypeScript 下工作。TypeScript 是为大型应用之开发而设计,而编译时它产生 JavaScript 以确保兼容性。</li>
</ol>
<p>安装:npm install -g typescript<br>编译:tsc app.ts # app.ts => app.js</p>
<h2 id="TypeScript数据类型"><a href="#TypeScript数据类型" class="headerlink" title="TypeScript数据类型"></a>TypeScript数据类型</h2><ul>
<li>Boolean类型:</li>
</ul>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">let</span> isDone: boolean = <span class="literal">false</span>; <span class="comment">// tsc => var isDone = false;</span></div></pre></td></tr></table></figure>
<ul>
<li>Number类型:</li>
</ul>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">let</span> count: number = <span class="number">10</span>; <span class="comment">// tsc => var count = 10;</span></div></pre></td></tr></table></figure>
<ul>
<li>String类型:</li>
</ul>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">let</span> name: string = <span class="string">'Semliker'</span>; <span class="comment">// tsc => var name = 'Semliker';</span></div></pre></td></tr></table></figure>
<ul>
<li>Array类型:</li>
</ul>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">let</span> list: number[] = [<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>]; <span class="comment">// tsc => var list = [1,2,3];</span></div><div class="line"><span class="keyword">let</span> list: <span class="built_in">Array</span><number> = [<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>]; <span class="comment">// tsc => var list = [1,2,3];</span></div></pre></td></tr></table></figure>
<ul>
<li>Enum类型:</li>
</ul>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">enum Direction {</div><div class="line"> NORTH,</div><div class="line"> SOUTH,</div><div class="line"> EAST,</div><div class="line"> WEST</div><div class="line">};</div><div class="line"><span class="keyword">let</span> dir: Direction = Direction.NORTH;</div></pre></td></tr></table></figure>
<ul>
<li>Any(动态类型):</li>
</ul>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">let</span> notSure: any = <span class="number">4</span>;</div><div class="line">notSure = <span class="string">"maybe a string instead"</span>;</div><div class="line">notSure = <span class="literal">false</span>;</div><div class="line">=> <span class="function"><span class="params">tsc</span> =></span></div><div class="line"><span class="keyword">var</span> notSure = <span class="number">4</span>;</div><div class="line">notSure = <span class="string">"maybe a string instead"</span>;</div><div class="line">notSure = <span class="literal">false</span>;</div></pre></td></tr></table></figure>
<a class="article-more-a" href="/2018/04/11/TypeScipt入门/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">js</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">TypeScipt</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2018/04/11/TypeScipt入门/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Angular2入门" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2018/04/09/Angular2入门/">Angular2入门</a>
</h1>
<a href="/2018/04/09/Angular2入门/" class="archive-article-date">
<time datetime="2018-04-09T02:28:22.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2018-04-09</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="Angular起源"><a href="#Angular起源" class="headerlink" title="Angular起源"></a>Angular起源</h2><p>2009年,Misko hevery和Adam Abrons在业务时间创造了GetAngular</p>
<h2 id="迭代之路"><a href="#迭代之路" class="headerlink" title="迭代之路"></a>迭代之路</h2><ol>
<li>12年6月,AngularJS1.0.0正式版推出:亮点功能基本齐备,如双向绑定、依赖注入、指令等</li>
<li>AngularJS 1.3.x放弃支持IE8浏览器:推出了单次绑定语法</li>
<li>AngularJS 1.5.x增加类似组件式书写体验:主要是为过渡Angular2做铺垫</li>
</ol>
<h2 id="AngularJS-1-x的困境"><a href="#AngularJS-1-x的困境" class="headerlink" title="AngularJS 1.x的困境"></a>AngularJS 1.x的困境</h2><ol>
<li>饱受诟病的性能问题:脏检查</li>
<li>落后于当前Web发展理念(如组件开发方式)</li>
<li>对手机端不够友好:并没有考虑移动端的适配;太笨重</li>
</ol>
<a class="article-more-a" href="/2018/04/09/Angular2入门/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">angular</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2018/04/09/Angular2入门/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-浅谈pc和移动端的事件机制" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/10/11/浅谈pc和移动端的事件机制/">浅谈pc和移动端的事件机制</a>
</h1>
<a href="/2017/10/11/浅谈pc和移动端的事件机制/" class="archive-article-date">
<time datetime="2017-10-11T06:58:01.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2017-10-11</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h3 id="事件机制:"><a href="#事件机制:" class="headerlink" title="事件机制:"></a>事件机制:</h3><ul>
<li>在事件机制中,有3样最重要的东西:<ul>
<li>事件生产者</li>
<li>事件对象</li>
<li>事件消费者</li>
</ul>
</li>
<li>事件生产者可以产生一系列的事件对象,然后事件对象携带着必要的信息,传递给事件消费者。<ul>
<li>单向的消息传递模型:事件消息总是由事件生产者传递给事件消费者;</li>
<li>双向的消息传递模型:让两者同时作为事件生产者和事件消费者;一个事件生产者产生的事件可以对应有多个事件消费者;一个事件消费者也可以接受多个事件生产者产生的事件消息;</li>
</ul>
</li>
</ul>
<h3 id="事件流及事件绑定"><a href="#事件流及事件绑定" class="headerlink" title="事件流及事件绑定"></a>事件流及事件绑定</h3><ul>
<li>EMCAScript标准规定事件流包含三个阶段:事件捕获阶段(传递过程),处于目标阶段,事件冒泡阶段(响应过程)。</li>
</ul>
<pre><code class="javascript">target.addEventListener(type, listener, useCapture);
<span class="comment">// 标准注册事件函数 </span>
<span class="comment">// target:文档节点、document、window 或 XMLHttpRequest。 </span>
<span class="comment">// 函数的参数:注册事件类型type,事件的回调函数,事件注册在捕获期间还是冒泡期间 </span>
<span class="comment">// 例如:给button注册onclick事件,要是在捕获阶段注册,则 button.addEventListener("click",function(){},true); </span>
target.removeEventListener(type, listener, useCapture); <span class="comment">//在某一个元素上撤销已注册的事件。</span>
</code></pre>
<a class="article-more-a" href="/2017/10/11/浅谈pc和移动端的事件机制/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">js</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2017/10/11/浅谈pc和移动端的事件机制/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-微信自动播放音频(视频同理)" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/10/09/微信自动播放音频(视频同理)/">微信自动播放音频(视频同理)</a>
</h1>
<a href="/2017/10/09/微信自动播放音频(视频同理)/" class="archive-article-date">
<time datetime="2017-10-09T06:49:43.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2017-10-09</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<pre><code class="javascript"><script>
<span class="comment">// 音乐播放</span>
<span class="function"><span class="keyword">function</span> <span class="title">autoPlayMusic</span>(<span class="params"></span>) </span>{
<span class="comment">// 自动播放音乐效果,解决浏览器或者APP自动播放问题</span>
<span class="function"><span class="keyword">function</span> <span class="title">musicInBrowserHandler</span>(<span class="params"></span>) </span>{
musicPlay(<span class="literal">true</span>);
<span class="built_in">document</span>.body.removeEventListener(<span class="string">'touchstart'</span>, musicInBrowserHandler);
}
<span class="built_in">document</span>.body.addEventListener(<span class="string">'touchstart'</span>, musicInBrowserHandler);
<span class="comment">// 自动播放音乐效果,解决微信自动播放问题</span>
<span class="function"><span class="keyword">function</span> <span class="title">musicInWeixinHandler</span>(<span class="params"></span>) </span>{
musicPlay(<span class="literal">true</span>);
<span class="built_in">document</span>.addEventListener(<span class="string">"WeixinJSBridgeReady"</span>, <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{
musicPlay(<span class="literal">true</span>);
}, <span class="literal">false</span>);
<span class="built_in">document</span>.removeEventListener(<span class="string">'DOMContentLoaded'</span>, musicInWeixinHandler);
}
<span class="built_in">document</span>.addEventListener(<span class="string">'DOMContentLoaded'</span>, musicInWeixinHandler);
}
<span class="function"><span class="keyword">function</span> <span class="title">musicPlay</span>(<span class="params">isPlay</span>) </span>{
<span class="keyword">var</span> audio = <span class="built_in">document</span>.getElementById(<span class="string">'music'</span>);
<span class="keyword">if</span> (isPlay && audio.paused) {
audio.play();
}
<span class="keyword">if</span> (!isPlay && !audio.paused) {
audio.pause();
}
}
autoPlayMusic();
<<span class="regexp">/script></span>
</code></pre>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">js</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">微信</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2017/10/09/微信自动播放音频(视频同理)/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-HTTP状态码301与302详解及区别" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/09/30/HTTP状态码301与302详解及区别/">HTTP状态码301与302详解及区别</a>
</h1>
<a href="/2017/09/30/HTTP状态码301与302详解及区别/" class="archive-article-date">
<time datetime="2017-09-30T06:50:40.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2017-09-30</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<ul>
<li>301 redirect: 301 代表永久性转移(Permanently Moved)</li>
<li>302 redirect: 302 代表暂时性转移(Temporarily Moved )</li>
<li>详细来说,301和302状态码都表示重定向,就是说浏览器在拿到服务器返回的这个状态码后会自动跳转到一个新的URL地址,这个地址可以从响应的Location首部中获取(用户看到的效果就是他输入的地址A瞬间变成了另一个地址B)——这是它们的共同点。他们的不同在于。301表示旧地址A的资源已经被永久地移除了(这个资源不可访问了),搜索引擎在抓取新内容的同时也将旧的网址交换为重定向之后的网址;302表示旧地址A的资源还在(仍然可以访问),这个重定向只是临时地从旧地址A跳转到地址B,搜索引擎会抓取新的内容而保存旧的网址。</li>
</ul>
<h3 id="什么是重定向?"><a href="#什么是重定向?" class="headerlink" title="什么是重定向?"></a>什么是重定向?</h3><p>就是地址A跳转到地址B。百度百科的解释:重定向(Redirect)就是通过各种方法将各种网络请求重新定个方向转到其它位置(如:网页重定向、域名的重定向、路由选择的变化也是对数据报文经由路径的一种重定向)。</p>
<a class="article-more-a" href="/2017/09/30/HTTP状态码301与302详解及区别/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">HTTP</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2017/09/30/HTTP状态码301与302详解及区别/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-HTTP基本概念" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/09/29/HTTP基本概念/">HTTP基本概念</a>
</h1>
<a href="/2017/09/29/HTTP基本概念/" class="archive-article-date">
<time datetime="2017-09-29T06:50:06.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2017-09-29</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h3 id="什么是HTTP"><a href="#什么是HTTP" class="headerlink" title="什么是HTTP"></a>什么是HTTP</h3><ul>
<li>HTTP是干嘛用的?<ul>
<li>学名:超文本传输协议,是一种网络协议。它是基于TCP/IP的应用层协议。被设计用于web浏览器和web服务器之间的通信,也可以用于其他目的。</li>
<li>因为是专门用来传输诸如HTML的超媒体文档等web内容的。因为HTML本身就是超文本标记语言,HTML中包含文本、图片、音视频等内容,所以用来传输它的协议自然就叫超文本传输协议了。</li>
<li>它是web上数据交换的基础,是一种client-server协议,请求通常是由浏览器发起。一个完整的web文档由不同的子文档重新组建成的,如文本,布局描述,图片,视频,脚本等。</li>
</ul>
</li>
<li>怎么和服务器通信?<ul>
<li>HTTP遵循经典的客户端-服务端模型,客户端打开一个连接以发出请求,然后等待它收到服务器端响应。HTTP是无状态协议,意味着服务器不会在两个请求之间保留任何数据(状态)。</li>
<li>客户端和服务端通过交互各自的消息(与数据流正好相反)来进行交互。通常由浏览器这样的客户端发出的消息叫做requests,那么被服务端回应的消息就叫做response。</li>
</ul>
</li>