/* ---------------------------- */ /* XMLHTTPRequest Enable */ /* ---------------------------- */ function createObject() { var request_type; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ request_type = new ActiveXObject("Microsoft.XMLHTTP"); }else{ request_type = new XMLHttpRequest(); } return request_type; } var http = createObject(); /* -------------------------- */ /* UPDATE */ /* -------------------------- */ /* Required: var nocache is a random number to add to request. This value solve an Internet Explorer cache issue */ var nocache = 0; function doLike(userid,nid) { // Optional: Show a waiting message in the layer with ID login_response //document.getElementById('onlinestatus_response').innerHTML = "" // Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding. var nstatus = 0; //encodeURI(document.getElementById('idStatus').value); //alert(nstatus); // Set te random number to add to URL request nocache = Math.random(); // Pass the login variables like URL variable http.open('get', '/web/ajaxsql_like_update.do?nid='+nid+'&nstatus='+nstatus+'&userid='+userid+'&nocache = '+nocache); http.onreadystatechange = insertLikeReply; http.send(null); } function HideLikeContent(d) { document.getElementById(d).style.display = "none"; } function insertLikeReply() { if(http.readyState == 4){ var response = http.responseText; //HideLikeContent('subCurrentLikeStat'); //document.getElementById('notification_like_status_response').innerHTML = ''+response; } }