Created loading function, javascript doesn't load.