I'm creating a website that could potentially contain many widgets. These widgets are rendered using external javascript code in external js files. Some of these widgets require the same external javascript files but i obviously dont want the browser including (ie: ) a javascript file whenever a widget requires one; instead it will only include a javascript file when it has not already been retrieved or is in the process of retrieving one.
Is there a javascript manager that can fulfill the requirements above? Extra points will be given to the solution with jQuery in mind :).