mike628 (3) [Avatar] Offline
#1
We’ll need our JavaScript to manage all our document changes; therefore, we need to
convert the HTML developed earlier into a JavaScript string.

I dont understand the NEED to do this. We can still manage the page without this, correct?
seasoup (37) [Avatar] Offline
#2
Re: Convert the HTML to JavaScript - 3.4.1
For simple examples no, but once you start building up an even moderately complex site the html has to be somewhere. We put it in the JavaScript so that it is all managed in one place. Another alternative that, for example, Angular uses is to do a lot of ajax calls to return html partials. That works too but has other disadvantages like having to do more server round trips and not having the html for that object embedded in the JavaScript file that defines the object.