Jquery Ajax

/**
  * saveEditData
  *
  * Disply save data
 */
function saveEditData1(items, id)
{
  var _content   = $("#txtAre_"+items).val();
  var _period    = $("#period_"+items).val();
  var _tabId     = $("#uxtabId").val();
  var _gadgetId  = $("#uxgadgetId").val();
  
  if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}
  else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}

  xmlhttp.onreadystatechange=function(){
         if (xmlhttp.readyState==4 && xmlhttp.status==200)
         {
            document.getElementById("div_reload").innerHTML=xmlhttp.responseText;
         }
  }
  xmlhttp.open("GET",'/gadgetTodo/ajax?id='+id+'&gadgetId='+_gadgetId+'&tabId='+_tabId+'&content='+encodeURI(_content)+'&period='+_period+'&type=save',true);
  xmlhttp.send();
  getLoadData(items, id, _content, _period, _tabId, _gadgetId);
}
function getLoadData(items, id, _content, _period, _tabId, _gadgetId)
{
  if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}
  else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
  xmlhttp.onreadystatechange=function(){
             if (xmlhttp.readyState==4 && xmlhttp.status==200)
             {
                document.getElementById("div_reload").innerHTML=xmlhttp.responseText;
             }
  }

  xmlhttp.open("GET",'/gadgetTodo/reload?gadgetId='+_gadgetId+'&tabId='+_tabId,true);
  xmlhttp.send();
}

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: