演示: http://web.mac.com/explon/Select/ (使用方式见源码)
Ext Core is a cross-browser JavaScript library for building dynamic web pages. It includes:
Ext Core supports all major web browsers including:
Class: Ajax
An Ajax class, For all your asynchronous needs.
Inherits methods, properties, options and events from <xhr>.
Arguments:
url - the url pointing to the server-side script.
options - optional, an object containing options.
Options:
data - you can write parameters here. Can be a querystring, an object or a Form element.
update - $(element) to insert the response text of the XHR into, upon completion of the request.
evalScripts - boolean; default is false. Execute scripts in the response text onComplete. When the response is javascript the whole response is evaluated.
evalResponse - boolean; default is false. Force global evalulation of the whole response, no matter what content-type it is.
Events:
onComplete - function to execute when the ajax request completes.</xhr>
>var myAjax = new Ajax('js.txt', {method: 'get', update: $$('body'), evalScripts: true}).request();js.txt:
<script type="text/javascript"> alert('TEST'); </script>