Why not simply:
markup = [];
markup.push('<html>');
markup.push('<head>');
markup.push('</head>');
markup.push('<body>');
markup.push('<h1>Sample \'StringBuilder\' HTML</h1>');
markup.push('</body>');
markup.push('</html>');
alert(markup.join('\n\r'));
markup.toString() could also be used if there is no need to add any separator. Uses native Javascript with no need for AJAX, or ASP.NET. Should therefore work cross-platform and cross-browser.