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

PHP數字轉國字...

PHP數字轉國字...

什麼鬼...客戶系統的需求竟然有一個數字要轉成國字.... 數字轉國字...數字轉國字...就是要把...

PHP 如何檢測陣列是否有重複值

PHP 如何檢測陣列是否有重...

pexelsphoto55 PHP陣列,是在coding時常用到的儲存資料的方式。 但,若陣列中的資...

JavaScript的獲取日期代碼不足兩位數補0

JavaScript的獲取日...

當我們用javascript得到了一個時間後...針對月份及日期的部分只會顯示數字... funct...

Recommended reading

Other stories happened at this address

青椒炒肉絲佐高粱

青椒炒肉絲佐高粱

很簡單,卻也很下飯。 家裡買的沙茶也放了一陣子了,這晚就決定來盤沙茶口味的青椒炒肉絲。 其實我也不清...

一早開機就遇到這畫面,是說我可以提早收工了嗎?

一早開機就遇到這畫面,是說我...

一早開機就遇到這畫面,是說我可以提早收工了嗎?

1歲9個月

1歲9個月

歲個月~ 凡事都有第一次,對於這麼小的年紀,一切更是新鮮有趣~但可不包括現在這樣子。 人生第一次長針...

你多久沒有展翅高飛了?

你多久沒有展翅高飛了?

s 多久?沒有展翅高飛了? 隨著年紀越大,卻越不夠勇敢。 愛作夢的年紀,漸漸的被現實中的生活所取代~...

小黃瓜拌炒豬肉片佐高粱

小黃瓜拌炒豬肉片佐高粱

s 最近氣候多變,有時候冷得不像話~ 因此,原本想要拿來涼拌的小黃瓜,也改變了製作方式~用炒的( ̄∇...

淡紅色小藥丸

淡紅色小藥丸

s Drug Name Diclofenac mg tab 從沒想過,所謂的坐骨神經痛會發生在自己身...

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