Hello, I want to add a button to the comment and load utterances after the user clicks.
I use setInterval to check the utterances height, when height!="" is means utterances Loading completed. Demo
int=self.setInterval("iFrameLoading()",200);
function iFrameLoading(){
var utterances=document.getElementsByClassName('utterances');
if(utterances.length==1){
if(utterances[0].style.height!=""){
int=window.clearInterval(int);
console.log("utterances Load OK");
}
}
}
Is there a better way to achieve this functionality?
Hello, I want to add a button to the comment and load utterances after the user clicks.
I use
setInterval
to check the utterances height, whenheight!=""
is means utterances Loading completed. DemoIs there a better way to achieve this functionality?