If you are using relative urls to you resources you might have got the problem with dead images and resources that doesn’t load. The obvious choice is to add the full url to the images.
The problem is often related to when you autolaunch an XPage on database open.
If you have a custom control and this control can be added more that once on a page.
You will probably get problems if it relies on some clientside libraries.
There is at least three ways to this problem.
1. Don’t add the client lib to the Custom Control add it to the XPage instead
Is this a good approach, no I don’t think so because you need to remember to add it, and also update it.
2. Add it in a theme globally
If you do it this way your library will always be added to all pages even if you do not need it.
3. Add it inside the Custom Control
This is the best approach in my opinion
Just add a computed text to your custom control
Add this code to check a requestScope var if it has a value if not add script lib.
You could evolve this code by inserting it into the head tag but It will work.