You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
605 B

  1. function removeDiff(id, html, id2) {
  2. var wrapper= document.createElement('div');
  3. wrapper.innerHTML = html;
  4. var nodes = wrapper.childNodes;
  5. target = document.getElementById(id);
  6. if(target) {
  7. for(i = 0; i < nodes.length; i++) {
  8. var n = nodes[i];
  9. // The notification is already here ?
  10. if(document.getElementById(id2) == null) {
  11. target.appendChild(n);
  12. setTimeout(function() {
  13. n.parentNode.removeChild(n);
  14. },
  15. 6000);
  16. }
  17. }
  18. }
  19. }