show loading icon until the page is load?

前端 未结 7 1349
不知归路
不知归路 2020-11-29 19:42

I wanted to show a loading icon to users until the page elements are fully loaded. How can I do that with javascript and I want to do it with javascript, not jquery?

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 20:41

    Element making ajax call can call loading(targetElementId) method as below to put loading/icon in target div and it'll get over written by ajax results when ready. This works great for me.

    Loading...

提交回复
热议问题