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

如何用javascript接收radio button被選取後的值

如何用javascript接...

剛剛竟然犯了最簡單的錯誤~ 而且還是在趕著時間的時候⊙⊙ 我竟然蠢到用接收input 的方式去接收 ...

行事曆功能導入

行事曆功能導入

cc55 Innstory有行事曆囉! 我試著把Innstory當作是我的筆記本,將生活發生的故事紀...

解決FB分享帶參數問題

解決FB分享帶參數問題

又到了FB分享連結的時間了,沒辦法FB太紅...@@... 一般來說如果是以FB的分享網址做分享的方...

Recommended reading

Other stories happened at this address

爬行訓練從Pumping開始( ̄∇ ̄)

爬行訓練從Pumping開始...

爬行訓練從Pumping開始( ̄∇ ̄)

Android Studio 2.3 隨機改變背景顏色

Android Studio...

class 開始學習APP 其實我照著工具書上的方式總是在宣告變數時會產生問題~ 例如工具書上寫著可...

來一碗蝦麵吧~

來一碗蝦麵吧~

繼上回的咖哩麵後~我跟Mandy一直念念不忘那味道.........。 這次再來挑戰蝦麵(福建麵)!...

說好的立秋呢?我以為現在是大暑!!

說好的立秋呢?我以為現在是大...

說好的立秋呢?我以為現在是大暑!!

口腔期加上爬行,有時候不禁懷疑我養的到底是小孩還是蛞蝓?

口腔期加上爬行,有時候不禁懷...

口腔期加上爬行,有時候不禁懷疑我養的到底是小孩還是蛞蝓?

果然還是紅白機對了胃口~

果然還是紅白機對了胃口~

果然還是紅白機對了胃口~

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