This is a very tiny javascript code to do an AJAX Request:
1 2 3 4 5 6 7 8 | /* m: method ("get", "post") u: url a: async (true) or sync (false) c: callback (with 'xhr' as a parameter) d: post_data (the data to post) */ function tiny_ajax(m,u,a,c,d){ with ( new ( this .XMLHttpRequest||ActiveXObject)( "Microsoft.XMLHTTP" ))onreadystatechange= function (){readyState^4||c( this )},open(m,u,a),send(d)} |
And an example:
1 2 3 |