Loading...

javascript 底下使用 htmlspecialchars

Temperature: 0 °C

ChungChung
author_tools


javascript 底下使用 htmlspecialchars
Javascript中使用一個函數達到PHP的htmlspecialchars。

以下範例

function decodeHtml(str)
{
var map =
{
'&': '&',
'&lt;': '<',
'&gt;': '>',
'&quot;': '"',
'&#039;': "'"
};
return str.replace(/&amp;|&lt;|&gt;|&quot;|&#039;/g, function(m) {return map[m];});
}

以上紀錄

台北市內湖區江南街71巷75弄 Go

https://innstory.com/story-javascript_底下使用_htmlspecialchars-1515
寫程式筆記

Prev
 在手機上如何建立網址到手機桌面中並且使用圖示

Next
布拉格老城區耶誕市集 

Nearby Attractions

台北市內湖區江南街71巷75弄-Nearby Attractions

  • 臺灣民主紀念園區 Go
  • 大稻埕辜宅 Go
  • 圓山別莊 Go
  • 婦聯總會 Go
  • 骨科醫院及住宅 Go
  • 鐵道部部長宿舍 Go

About the Author

Chung

我是chung
網路工作者
主業是網站系統開發建置
副業是做夢,寫故事
作品請參考/teme.biz
做夢請參考/innstory.com
聯絡/chung.teme@gmail.com

#有人用筆寫日記,有人用歲月寫日記,有人用照片寫日記,而我,用innstory寫日記。

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

分享 (励志短片) 王德顺 《最炫东北人》 完整版 Wang Deshun - Coolest Northeasterner (Inspirational Short Film)

分享 (励志短片) 王德顺 ...

我們都還年輕啊~ 還是可以一直做夢下去的。 只要有夢,我將可以走的更遠。 我是chung 主業做夢,...

PHP如何將陣列組合接成字串

PHP如何將陣列組合接成字串...

$arr = array(&#;hello&#;,&#;word&#;); echo implode...

PHP的日期時間相減方法之二

PHP的日期時間相減方法之二...

這幾天很忙...忙著寫客戶的系統.. 忙到沒時間亂開其他網站... 忙到沒時間去研究新東西... 忙...

Recommended reading

Other stories happened at this address

禦寒聖物,有了他,管他寒流來不來~

禦寒聖物,有了他,管他寒流來...

禦寒聖物,有了他,管他寒流來不來~

Today home activity: Learning variety shapes and their names

Today home act...

Today home activity: Learning variety shapes and t...

兒子開始發揮畢卡索的藝術天份,只是...在鞋墊上塗鴉是新的作品?

兒子開始發揮畢卡索的藝術天份...

兒子開始發揮畢卡索的藝術天份,只是...在鞋墊上塗鴉是新的作品?

清炒長年菜佐5U的咿咿呀呀

清炒長年菜佐5U的咿咿呀呀

在台灣,我們客家人一直對長年菜有種特殊的情感。 逢年過節的時候家裡常會煮上鹹菜湯、梅干扣肉...等年...

5U的第1張生日卡片

5U的第1張生日卡片

s U的第張生日卡片,謝謝威廷跟瓊慧的用心。 U也謝謝威廷姊夫跟瓊慧姊姊\(^o^)/ 感覺這週是U...

就是要這樣挨著~

就是要這樣挨著~

s 忘了從甚麼時候開始~U睡覺喜歡挨在我身邊。 每當我坐在床上,他會開心的從遠處爬來。 然後一個翻身...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format