The loading container should be created through a template rather than in javascript.