- Timestamp:
- Apr 5, 2015 12:48:13 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/js/Utilities.js
r500 r506 70 70 71 71 /* 72 * Encode HTML by proxying content via an in-memory div, setting its inner text which jQuery automatically encodes.72 * Encode/decode HTML by proxying content via an in-memory div, setting its inner text which jQuery automatically encodes. 73 73 Then we pull the encoded contents back out. The div never exists on the page. 74 74 --------------------------------------------------------------------- 75 75 $('select').append($('<option>', { 76 76 value: value, 77 text: htmlEncode(text)77 text: Strangecode.htmlEncode(text) 78 78 })); 79 79 --------------------------------------------------------------------- 80 80 * 81 81 * @access public 82 * @version 1. 082 * @version 1.1 83 83 * @since 30 Jun 2013 84 84 */ … … 86 86 return $('<div/>').text(text).html(); 87 87 }; 88 jQuery.fn.htmlEncode = Strangecode.htmlEncode; 88 Strangecode.htmlDecode = function(text) { 89 return $('<div/>').html(value).text(); 90 };
Note: See TracChangeset
for help on using the changeset viewer.