|
|
@@ -377,3 +377,24 @@ String.prototype.addComma = function(decimalPosition) {
|
|
|
String.prototype.removeComma = function() {
|
|
|
return this.replace(/,/gi,"");
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @type : prototype_function
|
|
|
+ * @access : public
|
|
|
+ * @desc : 자바스크립트의 내장 객체인 String 객체에 &,<,>,",' 브라우져 출력용 변환한다.
|
|
|
+ * <pre>
|
|
|
+ * "<문자열>".escapeHtml();
|
|
|
+ * </pre>
|
|
|
+ * @return : 콤마(,)가 제거된 스트링
|
|
|
+ * @author : gagamel
|
|
|
+ */
|
|
|
+String.prototype.escapeHtml = function() {
|
|
|
+ var map = {
|
|
|
+ '&': '&',
|
|
|
+ '<': '<',
|
|
|
+ '>': '>',
|
|
|
+ '"': '"',
|
|
|
+ "'": '''
|
|
|
+ };
|
|
|
+ return this.replace(/[&<>"']/g, function(m) { return map[m]; });
|
|
|
+}
|