Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

jQuery does not sanitize HTML. This is why jQuery is no longer necessary, even if people think it is.


There is the jquery bashing again. let sanitizedHTML = $('<div>').text(unsanitizedHTML).html();


You can 100% do that same thing without jQuery. It's not even complicated.

And that is not what the new .setHTML() does.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: