Request.HTML
Sends HTML code to backend updates target div and executes <script>
by Cindy Cullen
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
new Request.HTML({
url: '/echo/html/',
data: {
html: "<p>Text echoed back to request</p>" + "<script type='text/javascript'>$('target').highlight();<\/script>",
delay: 3
},
method: 'post',
update: 'target'
}).send();