How to make an AJAX request on page load

前端 未结 7 1423
耶瑟儿~
耶瑟儿~ 2021-01-28 01:47

I need to call GetAllProperties() function during page loading instead of calling the GetAllProperties() function after page is fully loaded. My code l

7条回答
  •  生来不讨喜
    2021-01-28 02:01

    You want to start the function during loading and not afterwards? Then place the call GetAllProperties(); as most early as possible. Best place would be in .

    But keep in mind, you need to place it after the inclusion of the GetAllProperties function itself. And the function has to be declared in the same file.

    Otherwise the execution is delayed by loading the script file, or it is delayed by the loading DOM, when you place it at the bottom of your page.

提交回复
热议问题