Read IFrame content using JavaScript

后端 未结 4 1226
误落风尘
误落风尘 2020-12-10 19:37

Ok, This is my first time dealing seriously with IFrames and I cant seem to understand a few things:

First the sample code I am testing with:



        
4条回答
  •  借酒劲吻你
    2020-12-10 20:03

    I was having a hard time getting the contents of a TXT file that was the src of an iframe. This is my solution:

    document.getElementById( 'iframeID' ).contentWindow.document.body.innerText
    

提交回复
热议问题