I have a currency widget in my pages that loads pretty fast. However, sometimes it takes forever to load and eventually the page gives up and load without it. Thta part is fine; the problem is that meanwhile some 15 seconds went by with only part of the left sidebar (where the widget resides) visible.
Obviously, as the page loads there is a request to the widget’s external site, and if this is down for some reason (updating?) my pages uffer.
Is there a way of telling the page not to connect to that site UNLESS the visitor actually starts to use the widget?
No, the widget must be visible, otherwise the visitor does not know that it exists.
How do you do that?
What I need is for the widget to connect to the external server, ONLY when the visitor does something to it: enter a value, change pair of currencies, or even if necessary when he clicks anywhere on it.
The problem here is that widget cannot be visible before it was loaded.
As you can see, widget code that you insert on your page doesn’t have any inputs.
Widget interface is built dynamically by its script.
So, that means you have to load script to display widget.
An alternative solution would be to simply dynamically load the widget after the rest of the page is loaded so that it will be available as soon as possible but without delaying the loading of the rest of the page.
Yeah, that is a solution too although not so simple, as that widget uses document.write to build an interface. So if you insert it at the bottom of page you’ll have to catch the output somehow and place it in the correct position on the page
But my other question is to understand the loading as seen through FF Web Console… is it being loaded, or not?
I’ve just tried the Web Console on the Barcelona page, that is live and there also the widget does not show up as being losded. Could it be that it is only loaded wheb the user enters something in it? In which case my problem may not be real?
What does hold things up there is the loading of the converter1.php…