How do I load a webpage inside a div using Javascript without IFRAME and JQuery?

后端 未结 4 918
时光说笑
时光说笑 2021-01-16 01:00

I need to load an external webpage into a div. I don\'t want to use an iFrame. And I want this done with plain Javascript. I\'m not sure how to go about it.

4条回答
  •  滥情空心
    2021-01-16 01:53

    You should be able to load html pages within a page using the jQuery.get() method. I'm using this method for two websites for my clients, where the individual pages are different sections of the site.

    I'm unsure of the behavior you may encounter if you attempt to use this method loading full HTML pages that include header information and the body tag. I recommend using it to load HTML snippets.

    jQuery.get()

提交回复
热议问题