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如何將陣列組合接成字串...

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

JavaScript 檢查 Radio Button

JavaScript 檢查 ...

要用 JavaScript 來檢查同一組的 radio button 是否已選,可用以下方法: if...

PHP使用GD函數切正方形圖像

PHP使用GD函數切正方形圖...

基本上大都是等比例將圖片上傳.... 但有時也會有需要正方形邊長的圖像需求 這時候還是得靠GD函式了...

Recommended reading

Other stories happened at this address

笑起來,跟Mandy小時候一模一樣。

笑起來,跟Mandy小時候一...

笑起來,跟Mandy小時候一模一樣。

桌底下的探險

桌底下的探險

拿著我的手電筒像似如獲至寶般的鑽進桌底下。 U開始了他在桌底下的探險。 看著他開心極了的笑臉,倒也覺...

10個月的5U,吃個飯像大爺啊~( ̄∇ ̄)

10個月的5U,吃個飯像大爺...

image U十個月了。 充滿好奇心的年紀,雖然會認人了,但試驗了幾次之後似乎不怎麼怕生。 不挑食,...

SSL憑證

SSL憑證

pexelsphotossl 終於~為innstory申請了SSL安全憑證。 安裝的過程中出了點狀況...

Apache無法執行.htaccess?

Apache無法執行.hta...

pexelsphoto 首先.htaccess是在Apache HTTP Server服務器架設下,...

你多久沒有展翅高飛了?

你多久沒有展翅高飛了?

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

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