How to load page synchronously using jQuery

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

    Just change document.location.href to the url of the page.

    What you're doing is loading content with ajax and placing it within the page body. You'd do this if you didn't want any resources declared in head to get requested. But there's no point in that since you can do it with caching.

提交回复
热议问题