How to load page synchronously using jQuery

后端 未结 6 1170
遥遥无期
遥遥无期 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:48

    You can form it as an AJAX request and populate your page with the response. Set the async option to false. This SO answer has more: How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?

提交回复
热议问题