document loading modules from javascript