加入 empty item 方便排版

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
	<style>
.games .item {
width: 360px;
margin: 0 10px 20px 10px ;
......
}
.games .item-empty {
margin: 0 10px 10px ;
width: 360px;
}
</style>
<body>
<ul class="games">
<li class="item">
<a href="#">
</a>
<img src="https://static-cdn.jtvnw.net/previews-ttv/live_user_therealknossi-640x360.jpg" alt="">
<div class="user">
<div class="avatar">
<img
src="https://static-cdn.jtvnw.net/jtv_user_pictures/574228be-01ef-4eab-bc0e-a4f6b68bedba-profile_image-300x300.png"
alt="">
</div>
<div class="user-info">
<div class="user-name">Sneaky | ggEZ</div>
<div class="user-id">robert</div>
</div>
</div>
</li>
<div class="item-empty"></div>
<div class="item-empty"></div>
</ul>
</body>
閱讀全文 »

favicon.ico Failed to load resource: the server responded with a status of 404 (Not Found)

1
2
3
4
5
6
7
<!-- #1 將favicon.ico 放於根目錄 -->

<!-- #2 加入以下代碼 -->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">

<!-- #3 加入以下代碼 -->
<link rel="shortcut icon" href="#"/>
閱讀全文 »

基本

  • schema : 結構
  • 編碼與排序 : 建議 utf8_general_ci
  • Pimary Key(PK) : 主鍵
  • Unique : 在 table 內,資料唯一
  • CRUD : 新增(Create)、讀取(Read)、更新(Update)、刪除(Delete)
  • 類型
    • InnoDB
    • MyISAM 不支援 Transaction(交易)
閱讀全文 »

名詞

雜湊(Hash) : 將目標文字轉換成具有相同長度的、不可逆的雜湊字串

加密(Encrypt) :是將目標文字轉換成具有不同長度的、可逆的密文

如 MD5, SHA256

跨網站指令碼(Cross-site scripting,簡稱XSS) : 是一種網站應用程式的安全漏洞攻擊,是代碼注入的一種

1
2
3
4
5
6
7
8
9
10
11
12
<!-- 測試網站是否有正確處理特殊字元: -->
><script>alert(document.cookie)</script>
='><script>alert(document.cookie)</script>
"><script>alert(document.cookie)</script>
<script>alert(document.cookie)</script>
<script>alert('vulnerable')</script>
%3Cscript%3Ealert('XSS')%3C/script%3E
<script>alert('XSS')</script>
<img src="javascript:alert('XSS')">
<!-- 可導到釣魚網站或dump cookie -->
<script>location.href="https://google.com"</script>
<script>alert(document.cookie)</script>
閱讀全文 »

escape HTML function

1
2
3
4
5
6
7
// escape HTML function
function escapeHTML(text) {
var replacements= {"<": "&lt;", ">": "&gt;","&": "&amp;", '"': "&quot;"}
return text.replace(/[<>&"]/g, function(character) {
return replacements[character];
});
}
閱讀全文 »

簡介

名詞

  • Client-side Render(CSR) : API get data 再由 JavaScript 渲染
  • Server-side Render(SSR) : 在 Server-side 就先渲染成 HTML
  • Search Engine Optimization(SEO) : 搜尋引擎最佳化,透過了解搜尋引擎的運作規則來調整網站,以及提高目的網站在有關搜尋引擎內排名的方式

JavaScript 的功能

  • 介面 : 改變介面
  • 事件 : 監聽事件並做出反應
  • 資料 : 與伺服器交換資料
閱讀全文 »

網站嵌入 Google 地圖

  • goole 地圖選到 地點
閱讀全文 »

Demo

tag a 連非中間文字都可選

1
2
3
4
5
6
7
/* set inline-block 加 padding */
a {
display: inline-block;
padding: 12px 20px;
color: black;
text-decoration: none;
}
閱讀全文 »

Application

馬克鰻(markman)

圖檔 長度測量/標記, 矩形座標&長寬測量/標記,顏色測量/標記,文字標記

按鍵 功能
Tab 自動偵測長度
Del 刪除標記
閱讀全文 »