SSH上傳/下載本地檔案到linux伺服器
阿新 • • 發佈:2021-07-08
1.
轉義字元的寫法。
在html標籤中使用。
可以寫多個,每有一個則會渲染出一個空格,不會像按多個空格鍵一樣,最終只顯示一個。
<div>1 2</div> // 1 2
<div>1 2</div> // 1 2
注意:&和結尾的;都不能少
2. 
ASCII編碼的寫法。
在html標籤中使用。
寫一個和同時寫多個一樣,最終只顯示一個,類似於按空格鍵
<div>1 2</div> // 1 2
<div>1 2</div> // 1 2
在js中使用。
可以使用String.fromCharCode(),引數是#後面的數字,可以輸出多個空格
console.log(1+ String.fromCharCode(32) + String.fromCharCode(32) + String.fromCharCode(32) +2) // 1 2
3.\xa0
\xa0屬於latin(ISO/IEC_8859-1,拉丁字母)中的擴充套件字符集字元,代表空白符nbsp(non-breaking space)
在html標籤中使用。
和 一樣,可以寫多個,顯示多個
<div>12</div> // 1 2
在js中使用。
在js中不需要&#,且可以連續寫而不用拼接
console.log(1+ '\xa0\xa0\xa0\xa0' +2) //1 2
4.U+0020
屬於Unicode字元
在js中使用。用法和\xa0一樣
console.log(1+ '\u0020\u0020\u0020\u0020' +2) // 1 2
5.\x20
標準鍵盤碼值表-十六進位制
在html標籤中使用。只顯示一個
<div>1 2</div> // 1 2
在js中使用。
console.log(1+ '\x20\x20\x20\x20' +2) // 1 2
http://www.ssnd.com.cn 化妝品OEM代加工
6.%20
對URI 進行解碼的樣式,需要用到decodeURIComponent 在js中使用。console.log(1+ decodeURIComponent('%20')+decodeURIComponent('%20')+decodeURIComponent('%20') +2) // 1 2
7.\t
這種相當於按了tab鍵,一個相當於4個空格 在js中使用.console.log(1+ '\t\t\t\t' +2) // 1 2