我们可以在react render中使用dangerouslySetInnerHTML在dom中正确加载html字符串。但是,如果我们可以在html字符串中添加一些javascript或jquery代码,我们该怎么做。例如下面。带有javascript/jquery的html作为api响应。用react.js中的javascript/jquery字符串呈现html
var htmlString = "<div>Hello</div><script>alert('hello')</script>"