red indian - 2011-03-01 14:16:25 -
In reply to message 1 from red indian
Just did a quick test and it works!
You only have to convert < and > to get html back from <noscript> tags.
Demo code:
<html>
<body>
<!-- Container for HTML -->
<noscript id="ad">This is the content when the script is disabled. It also supports <b>html</b> tags.</noscript>
<!-- Div with yellow background to fill with HTML -->
<div id="ad-target" style="background:yellow;"></div>
<script type="text/javascript">
// Get html
var html = document.getElementById('ad').innerHTML;
// Convert < and >
html = html.replace( /</ig, '<' ).replace( />/ig, '>' );
// Just for fun to indicate javascript enabled or disabled
html = html.replace( /disabled/, 'enabled' );
// Write the div with yellow background
document.getElementById('ad-target').innerHTML = html;
</script>
</body>
</html>