Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

如何判断动态插入的html解析完毕?

有一个场景:有一段动态html1要插入到页面中,等html1渲染完毕后再请求一段html2插入到html1的指定位置。不要说用settimeout。因为html1长度是不固定的,也就是渲染的时间也是不固定的。所以如何保证html2字段能正确渲染到页面上?### 问题描述

问题出现的环境背景及自己尝试过哪些方法

相关代码

粘贴代码文本(请勿用截图)

你期待的结果是什么?实际看到的错误信息又是什么?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

看看html1中有没有特殊id,class之类的元素,通过document.getElementById等DOM查找元素的方法作为一个判断依据试试


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

Just Browsing Browsing

[7] html - How to create even cell spacing within a

2.1m questions

2.1m answers

60 comments

57.0k users

...