Web Development How-to, Tips and Tricks
Top Banner
Saturday, July 25, 2015
Proper Jquery document ready
Here is a short and simple JQuery document ready I use:
<script type="text/javascript">
//<![CDATA[
$(document).ready( function(){
.....
});
//]]>
</script>
Javascript equivalent of PHP htmlspecialchars() function
Javascript version of PHP htmlspecialchars() function
function escapeHtml(text) {
var map = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
};
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
}
Newer Posts
Home
Subscribe to:
Comments (Atom)