client-side js load a template either from DOM or external url via ajax