load resource with js