在页面引入主脚本
,主脚本
执行后,在入口
节点中创建iframe
,再在其中创建评论表单、评论列表和相关样式。
最后,所有脚本执行完毕后生成的DOM
树结构为:
<!--入口-->
<div id="luantan">
<!--iframe-->
<iframe data-reactroot="" scrolling="false" horizontalscrolling="no" verticalscrolling="no">
<html>
<head>
</head>
<body>
<link rel="stylesheet" type="text/css" href="">
<div><!--comment form--></div>
<div><!--comment list--></div>
</body>
</html>
</iframe>
</div>
<!--主脚本-->
<script src="./luantan.js"></script>