Ajax
Ajax demo
本页范例参考文档JavaScript代码 | HTML代码 | CSS代码
$('start').addEvent('click', function(e) {
e = new Event(e).stop();
var url = "/mootools_demo/Ajax/lipsum.html";
/**
* The simple way for an Ajax request, use onRequest/onComplete/onFailure
* to do add your own Ajax depended code.
*/
new Ajax(url, {
method: 'get',
update: $('log')
}).request();
});
<h3>Simple Ajax Request</h3>
<p><a id="start" href="#">Click here</a> to start Ajax request</p>
<div id="log">
<p>Waiting...</p>
</div>
#log {
background: #f8f8f8;
border: 1px solid #d6d6d6;
border-left-color: #e4e4e4;
border-top-color: #e4e4e4;
padding: 0.3em;
margin-top: 10px;
}
#start a {
font-weight: bold;
}
Simple Ajax Request
Click here to start Ajax request