javascript - Sanitize codes injection using jQuery -
i using comment box , insert value mysql using ajax. same time append entered comment jquery same page. problem if entered text javascript code, like
<script>alert('hello');</script>
it shows alert. in database sanitize these code since append in client side need display entered text is.
well use,
<div contenteditable="true"></div>
any immediate help, please?
the next snippet html encodes string to:
"<div>here html</div" $("p").text("<div>here html</div").html()
javascript jquery
No comments:
Post a Comment