Show div from another website

后端 未结 4 822
独厮守ぢ
独厮守ぢ 2020-12-01 15:17

Is there a way to use an iframe or some other method of showing a named div from another website?

I want to pull in some data from a government website into a google

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 15:56

    Using JQuery, you should be able to exactly that with the load-function.

    Here is a small example to get a container with id "container" on a page called Test.html:

    $('#contentDiv').load('/Test.html #container');

    You can visit the JQuery documentation here for more info.

提交回复
热议问题