1.

Solve : JavaScript (ajax) not setting link innerHTML?

Answer»

I'm trying to get this to set a LINKS innerHTML every now and then according to the Ajax XMLHTTP's RETURN;

Code: [Select]function CheckBucks() {
 var CheckX = GetXHTTP();
 ////////////////
 CheckX.onreadystatechange=function()
 {
  if(CheckX.readyState==4)
  {
    document.getElementById('BucksAmountNavLink').innerHTML = '<font color=green>'+String(CheckX.responseText)+'</font>';
setTimeout('CheckBucks()', 1000);
   }
  }
 CheckX.open( 'GET' , 'JS/AssetBucks.php?user=5e4564a2s1s5e4w5re5t45g24&A='+String(Math.random())+'&B='+String(Math.random())+'&C='+String(Math.random())+'&D='+String(Math.random())+'' , true );
 CheckX.send( NULL );
 ////////////////////
 setTimeout('CheckBucks()', 1000);
}
It says runtime error on the line I try and set it.



Discussion

No Comment Found