Posted By

f on 01/28/09


Tagged

siteIndependent


Versions (?)

Remove embeds, iframes and objects


 / Published in: JavaScript
 

  1. /*
  2. javascript: var embeds = document.getElementsByTagName("embed"); while (embeds.length) embeds[0].parentNode.removeChild(embeds[0]); var iframes = document.getElementsByTagName("iframe"); while (var cx = 0; cx < iframes.length) iframes[0].parentNode.removeChild(iframes[0]); var objects = document.getElementsByTagName("object"); while (objects.length) objects[0].parentNode.removeChild(objects[0]); undefined;
  3. */
  4. var embeds = document.getElementsByTagName("embed");
  5. while (embeds.length)
  6. embeds[0].parentNode.removeChild(embeds[0]);
  7. var iframes = document.getElementsByTagName("iframe");
  8. while (var cx = 0; cx < iframes.length)
  9. iframes[0].parentNode.removeChild(iframes[0]);
  10. var objects = document.getElementsByTagName("object");
  11. while (objects.length)
  12. objects[0].parentNode.removeChild(objects[0]);
  13. undefined;

Report this snippet  

You need to login to post a comment.