Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Javascript StringBuilder for Beginners (ASP.NET 3.5 and above)

, 21 Apr 2011
Rate this:
Please Sign up or sign in to vote.
Why not simply:markup = [];markup.push('');markup.push('');markup.push('');markup.push('');markup.push('Sample \'StringBuilder\' HTML');markup.push('');markup.push('');alert(markup.join('\n\r'));markup.toString() could...
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

GladToBeGrey

United Kingdom United Kingdom
No Biography provided

Comments and Discussions

 
GeneralReason for my vote of 5 Practical alternative with some good... PinprotectorAspDotNetDev21-Apr-11 10:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 21 Apr 2011
Article Copyright 2011 by GladToBeGrey
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid