View Single Post
Old 02-16-2008, 12:03 AM   #12 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Fine heres some of the code:
Code:
echo '<script type="text/javascript">
	  
	  var xmlHttp = new XMLHttpRequest();
	  
	  try {
	  // Intranet Explorer
	  xmlHttp = new ActiveXObject("Msxml.xmlHttp");
	  
	  } catch (e)
	  {
	  xmlHttp = false;
	  }
	  
	  try {
	   xmlHttp = new ActiveXObject("Micrsoft.xmlHttp");
	  } catch (e)
	  {
	  	xmlHttp = false;
	  }
	  
	  
	  function userAmount (id,amount)
	  {
	   xmlHttp.open("GET","***********/screenshots/?id=" + id + "&ua=" + amount, true);
	   xmlHttp.send(null);
	   
	  }
	  
	  function stateEffect()
	  {
	     if (xmlHttp.readyState != 4) 
   {
    starReturn.innerHTML = "<img src=\'http://***********/img/loading.gif\' alt=\'loading..\' title=\'Loading..\'> ";
    
    return false;
   } else if (xmlHttp.readyState == 4)
   {
   
     starReturn.value = "Successfully rated!";
     
    } else {
     starReturn.value =  xmlHttp.responseText; 
    }
    }
	  
 function StarRate (n,id,pre)
 {
 xmlHttp.open("POST","/?id=" + id + "&n=" + n + "&pre=" + pre, true);
  xmlHttp.send(null);
  
 starReturn = document.getElementById(\'starReturn\');
  
  xmlHttp.onreadystatechange = stateEffect();
  {    
   }
  }
</style>';
Yes I am trying to make a rating system with AJAX. So far the AJAX fails.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote