I have an odd requirement where we have static html/css/images. I then need to convert these static pages into pages that are dynamically generated with javascript/jquery. We are dealing with 100+ instances of this.
So for example:
<div id='foo' title='my title'>Hi there!</div>
would be converted to:
$('<div/>', {
id: 'foo',
title: 'my title',
text: 'Hi there!'
}).appendTo('#mySelector');
Is there a way to do this programmatically? I googled around but was not able to find anything.
$("#mySelector").append("<div id='foo' title='my title'>Hi there!</div>");. This keeps most of the structure of the original HTML. You may be able to do this with global replace in the editor.DOMinto ajsonstring, and then manually copy and paste that to save your own.jsonfile. From there, you could use JavaScript to load the pieces from the.jsonfile you want into the DOM.