Skip to content

Instantly share code, notes, and snippets.

@phred
Created October 9, 2009 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phred/206267 to your computer and use it in GitHub Desktop.
Save phred/206267 to your computer and use it in GitHub Desktop.
Comment on "advanced Javascript techniques" blog showing a nice way to format HTML-with-JS.
// Comment on http://sixrevisions.com/javascript/6-advanced-javascript-techniques-you-should-know/
pageContainer.innerHTML = array('',
'<h1>' + pageTitle + '</h1>',
'<div id="content">',
' <p>' + pageContent + '</p>',
' <div id="author_bio">',
' <p>' + authorBio + '</p>',
' </div>',
'</div>',
'<div id="footer">',
' <p>' + footerContent + '</p>',
'</div>').join('\n');
pageContainer.innerHTML = HTMLCode;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment