Skip to content Skip to sidebar Skip to footer

How To Include A File, And Wrap Its Contents In A `pre` Tag

I'm looking for an example demonstrating how to insert the contents of a file and wrap the contents in a pre tag -- e.g.,
 insert.txt 
. The usage will b

Solution 1:

You can try to simply add the <pre> tags through javascript:

document.write('<pre>');
document.write(ajaxRq.responseText);
document.write('</pre>');

This isn’t my preferred way of doing things but it works. jQuery will just make you type up less code.

Post a Comment for "How To Include A File, And Wrap Its Contents In A `pre` Tag"