var str = new Array();
str[0] = '<li id="domain-{0}">'.replace('{0}', 'domainid');
str[1] = 'domainname';
str[2] = '<input type="hidden" name="domainids" value="{0}">'.replace('{0}', 'domainid');
str[3] = '</li>';
alert(str.join(''));
//
// 示例2
//
var str2 = [
'<li id="domain-{0}">'.replace('{0}', 'domainid'),
'domainname',
'<input type="hidden" name="domainids" value="{0}">'.replace('{0}', 'domainid'),
'</li>'
];
alert(str2.join(''));