Clearinterval Doesn't Clearinterval
var timer; function check_element_load(){ timer = window.setInterval(function(){ console.log('still working'); // keeps running forever if(document.getElementB
Solution 1:
As it stands, your code is logical correct, however if
document.getElementsByTagName("fb:comments")[0].setAttribute('order_by', 'social');
throws an error, (of course) the timeout will never be cleared. You could use SetTimeout
instead.
Most likely calling getElementsByTagName("fb:comments")
returns an empty set, giving you an "method setAttribute does not exist on Element undefined" Type Error.
Post a Comment for "Clearinterval Doesn't Clearinterval"