问题描述
我正在用React创建类似于Codpen的东西,用户可以在其中输入HTML和JS代码,
然后在iframe
内运行它,并为其提供srcDoc
用户输入。像这样:
const render = () => {
const htmlCode = // the data from the user's input
const jsCode = // the data from the user's input
const input = `<html><body>${htmlCode}</body><script type="text/javascript">${jsCode}. </script></html>`;
return <iframe srcDoc={input}/>
}
我现在对暴露的漏洞一无所知。 您能指导我采取一些步骤吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)