Get innerhtml from external page with Javascript

前端 未结 6 571
离开以前
离开以前 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条回答
  •  野的像风
    2021-02-04 18:04

    You could create a hidden ', { css: { display: none }, src: 'my_page.html', id: 'my_mage', load: function() { var html = $('#my_page').contents().find('whatever').html(); } }); });

提交回复
热议问题