robert_gsfame Posted July 29, 2010 Share Posted July 29, 2010 i have this function to do the prevent html injection function htmlentities(str) { var i,output='',len,char=''; len = str.length; for(i=0;i47 && char<58)||(char>62 && char<127) ){ output += str; }else{ output += "&#" + str.charCodeAt(0) + ";"; } } return output; } but this is not working,anyone got an idea?? thx Quote Link to comment Share on other sites More sharing options...
xenophobia Posted July 30, 2010 Share Posted July 30, 2010 Before digging into what you're trying to do now, is that a reason to have a client script to escape your HTML string? Usually we do on server side before output to the client. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.