Ciao a tutti....
avrei questo problema...dovrei scrivere, dopo aver fatto un controllo, all'interno di un div.

ho provato a fare l'inserimento con:

document.getElementById(divId).innerHTML="Non ci sono elementi da visualizzare";

il problema è che non scrive niente!

Qualcuno sa dirmi dove sta il problema?

scrivo sotto un pezzo di codice cosi...magari serve a capire meglio...

Codice PHP:
<script type="text/javascript" language="JavaScript">
<!--
var list; 
var tickerObj; 
var hex = 255;

function fadeText(divId) {
  if(tickerObj)
  {
    if(hex>0) {
      hex-=5; // increase color darkness
      tickerObj.style.color="rgb("+hex+","+hex+","+hex+")";
      setTimeout("fadeText('" + divId + "')", fadeSpeed); 
    } else
      hex=255; //reset hex value
  }
}

function initialiseList(divId) {
  tickerObj = document.getElementById(divId);
  if(!tickerObj)
        document.write("Non ci sono elementi da visualizzare");  

    //reportError("Could not find a div element with id \"" + divId + "\"");
  list = tickerObj.childNodes;
  
  if(list.length <= 0)
    
    document.getElementById(divId).innerHTML="Non ci sono elementi da visualizzare";

//CONTROLLO SE C'è UN SOLO ELEMENTO E IN QUEL CASO LO VISUALIZZO
if (list.length == 1){
i=1;
node = list[i];
node.style.display = "block";

}  

  for (var i=0; i<list.length; i++) {
    var node = list[i];
    node.style.display = "none";     if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
              tickerObj.removeChild(node);
  }
  run(divId, 0);
}

function run(divId, count) {
  fadeText(divId);
  list[count].style.display = "block";
  if(count > 0)
    list[count-1].style.display = "none";
  else
    list[list.length-1].style.display = "none";
  count++;
  if(count == list.length)
    count = 0;
  window.setTimeout("run('" + divId + "', " + count+ ")", interval*1000);
}
function reportError(error) {
  alert("The script could not run because you have errors:\n\n" + error);
  return false;
}

var interval = <?php print $intervallo_news;?>; // interval in seconds
var fadeSpeed = <?php print $transizione_news;?>;

//-->
</script>