MooTools is a collection of JavaScript utilities designed for the intermediate to advanced JavaScript developer. It allows you to write powerful and flexible code with its elegant, well documented, and coherent APIs.
MooTools code is extensively documented and easy to read, enabling you to extend the functionality to match your requirements.
官网:http://mootools.net/
<!DOCTYPE> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="http://libs.baidu.com/mootools/1.4.5/mootools-yui-compressed.js"></script> <title>test</title> </head> <body> <button onclick="test()">test</button> <br> <div id="myElement"></div> <script type="text/javascript"> function test() { var myElement = document.id('myElement'); var myRequest = new Request({ url : 'http://localhost', method : 'get', onRequest : function() { myElement.set('text', 'loading...'); }, onSuccess : function(responseText) { myElement.set('text', responseText); }, onFailure : function() { myElement.set('text', 'Sorry, your request failed :('); } }); myRequest.send(); } </script> </body> </html>
时间: 2024-10-13 05:07:13