Welcome, Guest
Username: Password: Remember me

TOPIC: add a "loading" GIF while page is loading

add a "loading" GIF while page is loading 2 years 7 months ago #64823

  • atiut
  • atiut's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 76
  • Thank you received: 2
  • Karma: 1
I have a huge one-screen survey that had to include all towns and villages in Romania. Naturally, it loads slowly, so I would really need some warning to keep the respondents engaged.

Now, the behaviour of the page, measured on a slow connection is as follows:

Stage A: blank white page, elements are loading in the background: 10 sec (sic)
Stage B: graphical elements start loading: 0.5-1 sec
Stage C: the page is fully usable, but some elements (img tags etc) still load in the background: 3-4 sec

I have tried a couple of javascripts found on the net, but, at best, the image was shown in stages B and C, preventing the respondent to use the page until it loads fully.

What I need is a solution to cover A+B, though A alone would really be sufficient.

Also, after running a check on the page, it would seem that the Javascript took more than 50% of the overall load time. So maybe the GIF should be shown only as long as the Javascript is not fully loaded. (Note: the page is not script-intensive, i guess it is the std script processing lots of data)

I am using a modified version of the default theme.
The administrator has disabled public write access.

Re: add a "loading" GIF while page is loading 2 years 7 months ago #64838

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
You may not be able to insert an image in Stage A. That may be while the script(s) are accessing the database and constructing the DOM. Without a DOM you can't have an image.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: add a "loading" GIF while page is loading 2 years 7 months ago #64865

  • atiut
  • atiut's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 76
  • Thank you received: 2
  • Karma: 1
Thank you. It kind of makes sense.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.109 seconds
Donation Image