Get innerhtml from external page with Javascript

前端 未结 6 564
离开以前
离开以前 2021-02-04 17:47

I\'m trying to get innerHTML of a DIV that is located on external page. It is possible to do this using this kind javascript code?

    

        
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-04 18:00

    It's possible to do what you wish, but I would say you have to retrieve the external HTML file using XMLHttpRequest first.

提交回复
热议问题