I mean, I use this widget:
<script src="http://www.mywebsite.com/widget/widget.js?type=normal" type="text/javascript"></script> <div id="archie-container"></div>
To check if jquery is on the hosted website otherwise it will load it and execute some ajax / jsonp request. As suggested in this tutorial .
Well, I noticed big trolleybuses about CSS parents, integrated other jquery plugins (like a loop) and managed the data between this βinterfaceβ and the ajax call.
Why should I do this when I can use sngle iframe? I also noticed that if I load jquery from widget.js and (of course), I put it in an iframe (so that I can control individual functions), the library is taken from the cache. Therefore, no overload occurs.
Is this enough for you? Or am I missing something?
I also noticed that 90% of widgets (like FB, twitter, etc.) use this strategy (with iframe).
source share