have javascript file loading and functions being called determining type