Se il numero di elementi cambia a seconda che tu ti riferisca a quips, footnotes o text ti conviene utilizzare un indice diverso per ognuno di questi 3

Codice PHP:

function inizializza(){
                
                 
//genero gli indici casuali
                
indexTMath.floor(Math.random() * (text.length-1)) ; 
                
indexF Math.floor(Math.random() * (footnotes.length-1)) ; 
                
indexQ Math.floor(Math.random() * (quips.length-1)) ; 

                $(
'#text').attr("innerHTML"text[indexT]);
                $(
'#footnote').attr("innerHTML"'[url="' footnotes[indexF] + '"]' footnotes[indexF] + '[/url]');
                $(
'#quip').attr("innerHTML"quips[indexQ] );
            
            }