
Sajax = Class.create( {
initialize: function( uri, callback ) {
this.callback = callback;
var f = "callback" + Math.floor((Math.random() * 10000 ));
eval( f + " = this.response.bind( this );" );
if ( uri.search( /\?/ ) == -1 )
uri += "?";
else
uri += "&";
uri += "callback=" + f;
var tag = new Element("script");
tag.type = "text/javascript";
tag.src = uri;
var head = document.getElementsByTagName("head");
if ( !head || head.length < 1 )
document.body.appendChild( tag );
else
head[0].appendChild( tag );
},
response: function( data ) {
this.callback( data );
}
} );

