ancora una cosa se vi è possibile.
cerco di ampliare la funzione.. praticamente creando 10 variabili che contengono 10 stati del DIV 'contenuto'
non capisco perchè la funzione restore funge solo al primo click.. i successivi mi stampa nel DIV undefined
posto:
var CountHistory = 0
var JsonHistory = { "HS1" : "","HS2" : "","HS3" : "","HS4" : "","HS5" : "","HS6" : "","HS7" : "","HS8" : "","HS9" : "","HS10" : ""};
function History(){
var Contenuto = document.getElementById("Contenuto");
if CountHistory < 10{
CountHistory++;
}
JsonHistory = { "HS10" : JsonHistory.HS9};
JsonHistory = { "HS9" : JsonHistory.HS8};
JsonHistory = { "HS8" : JsonHistory.HS7};
JsonHistory = { "HS7" : JsonHistory.HS6};
JsonHistory = { "HS6" : JsonHistory.HS5};
JsonHistory = { "HS5" : JsonHistory.HS4};
JsonHistory = { "HS4" : JsonHistory.HS3};
JsonHistory = { "HS3" : JsonHistory.HS2};
JsonHistory = { "HS2" : JsonHistory.HS1};
JsonHistory = { "HS1" : Contenuto.innerHTML};
}
function Restore(){
var nCount = 'HS'+CountHistory;
CountHistory--;
document.getElementById('Contenuto').innerHTML = JsonHistory[nCount];
}