jQuery load body from external HTML

后端 未结 5 970
南笙
南笙 2020-12-17 09:15

I\'m using jQuery and trying to load the body from an external HTML file.

It works if I try to load some div:

$(\'body\').load(\'example.h

5条回答
  •  一个人的身影
    2020-12-17 09:54

    If you want to load the whole body, $('body').load('example.html'); should be enough.

    If not, could you explain why ?

    Anyway, the solution provided by Steve is the right one.

提交回复
热议问题