Get innerhtml from external page with Javascript

前端 未结 6 566
离开以前
离开以前 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 17:59

    the jquery load function allows you to specify an element id to load

    $('#result').load('ajax/test.html #container');
    

    http://api.jquery.com/load/

提交回复
热议问题