Ho un problema con 2 script, uno che visualizza in modo random alcune frasi e l'altro che mi stampa le note di copyright. Funzionano entrambi, ma contengono sicuramente degli errori.
Script 1:
function dixit() {
};
dixit = new dixit();
number = 0;
// dixitArray
dixit[number++] = "<span class='sottomenu'>\"Everyone told me to pass on Speed because it was a bus movie\"</span>"
dixit[number++] = "<span class='sottomenu'>\"Sure, I'm an optimistic, joyous person, but I'm also afraid and insecure\"</span>"
dixit[number++] = "<span class='sottomenu'>\"I mean, anybody can look cute after about three hours in hair and makeup, with a great set of makeup tools and a great haircutter\"</span>"
dixit[number++] = "<span class='sottomenu'>\"I love humor. I always will fall back on humor. That's something that I think you can't ever get enough of and, if it's done well, it's great. When it's bad, it's horrible\"</span>"
dixit[number++] = "<span class='sottomenu'>\"I've always been very skeptical about marriage, because I only want to do it once; I want to do it the right way\"</span>"
dixit[number++] = "<span class='sottomenu'>\"The older I get, the less mature I get and I like that. I just intend to channel my behaviour to benefit myself as well as others\"</span>"
dixit[number++] = "<span class='sottomenu'>[Sulla chirurgia plastica]\"If you do it, then do it well. Make sure you come out looking like yourself. You're comfortable being put under a knife and disembowelled? Great!\"</span>"
dixit[number++] = "<span class='sottomenu'>[Sullo status di star] \"It's nothing. It's money. It's people recognizing you from the covers of magazines. But it doesn't mean anything\"</span>"
dixit[number++] = "<span class='sottomenu'>\"Always choose people that are better than you. Always be a student. Once you find yourself to be a teacher, you've lost\"</span>"
dixit[number++] = "<span class='sottomenu'>\"Women should do a lot more fighting. I don't think it's fair that we can't get into good bar fight once in a while\"</span>"
increment = Math.floor(Math.random() * number);
richiamato nel codice html con document.write(dixit[increment]);
Script 2:
function addCopyrightNote() {
}
note = new addCopyrightNote();
number = 0;
note[number++] = "<span class='sottomenu'>Copyright © 2006-2007, Sandra Bullock Italian fansite."
increment = Math.floor(Math.random() * number);
richiamato nel codice html con document.write(note[increment]);
Qualcuno può darmi 1 mano a sitemarli??
Un'ultima cosa: le funzioni devono avere lo stesso nome del file .js, vero??
Grazie,
Laura