2014-12-22から1日間の記事一覧
"<"や">"をエスケープする時、jQueryを使うと1行で書ける。 $('<div />').text(string).html(); ユーティリティ関数化しておくと便利。 /** * HTML出力のエスケープ */function escapeHTML(string) { return $('<div />').text(string).html();}</div></div>
"<"や">"をエスケープする時、jQueryを使うと1行で書ける。 $('<div />').text(string).html(); ユーティリティ関数化しておくと便利。 /** * HTML出力のエスケープ */function escapeHTML(string) { return $('<div />').text(string).html();}</div></div>