Insert a Script into a iFrame's Header, without clearing out the body of the iFrame

后端 未结 1 908
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-22 06:20

I\'m looking to add a script to an iFrame\'s header while not losing everything contained in the iFrame\'s body or header...

here is what I have right now which does upd

相关标签:
1条回答
  • 2021-01-22 06:27
    var headID = document.getElementsByTagName("head")[0];         
    
    var newScript = document.createElement('script');
    newScript.type = 'text/javascript';
    newScript.src = 'yourpath';
    headID.appendChild(newScript);
    
    0 讨论(0)
提交回复
热议问题