How to load page synchronously using jQuery

后端 未结 6 1159
遥遥无期
遥遥无期 2021-01-23 04:03

Currently I am using jQuery to choose what my index page should load depending whether a cookie is set.

For example, the body tag of the index.html should load hasCookie

6条回答
  •  不要未来只要你来
    2021-01-23 04:42

    Try

    $(document).ready(function() { $(document.body).load('hasCookie.html'); });
    

    This will postpone loading until after everything else is already there.

提交回复
热议问题