Request.HTML
Sends HTML code to backend updates target div and executes <script>
by Palpatim
HTML
<div id='target'><p>This text will be replaced in 3 seconds</p></div>
CSS
body {
font-family: Helvetica, Sans, Arial;
}
p {
padding: 10px;
}
JavaScript
console.log('posting');
$.post(
'/echo/html/',
{html:'<p>jQuery Post results</p>'},
function(data, textStatus, jqXHR) {
console.log('success');
},
'text/html'
);
console.log('posted');