function ajax_send(method,url,data){ var xmlhttp=ajax_object(); if (!xmlhttp){ return false; } if(method=="GET"){ if(data == 'null'){ xmlhttp.open("GET",url,true); }else{ xmlhttp.open("GET",url+"?"+data,true); } xmlhttp.send(null); }else if(method == "POST"){ xmlhttp.open("POST",url,true); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttp.send(data); } return true; } function ajax_object(){ var xmlhttp = false; /*@cc_on @if (@_jscript_version >= 5) try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){ try{ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }catch(E){ xmlhttp = false; } } @else xmlhttp = false; @end @*/ if(!xmlhttp && typeof XMLHttpRequest!='undefined'){ try{ xmlhttp=new XMLHttpRequest(); }catch(e){ xmlhttp=false; } } if(xmlhttp){ xmlhttp.onreadystatechange=function(){ if(xmlhttp.readyState==4){ if(xmlhttp.status==200) { ajax_response(xmlhttp.responseText); } } } } return xmlhttp; } function ajax_response(d){ //alert(d); var a=new Array(); var r=d.split('&'); var p; a['response']=d; for(var i in r){ if(typeof r[i]=='string'){ p=r[i].split('='); a[p[0]]=p[1]; } } //alert(a['last_message_id']); main_receive_data(a); return false; }