Is there a better way to inject a dynamic text into the html string other than the code specified below?
var code = 'siteCode1';
html code as a string:
existing: '<p>Log in with your'+ eval("siteVarObj('+code+').siteName") +'account</p>',
function siteVarObj(siteCode){
if(siteCode === 'siteCode1'){
this.siteName = 'google.com';
this.siteContactUsURL = '';
}else if(siteCode === 'siteCode2'){
this.siteName = 'stackoverflow.com';
this.siteContactUsURL = '';
}
return this;
}