-1

私はまったくの初心者で、この JavaScript コードを任意のブラウザー (IE、FF、Chrome) で実行しようとしています。Firebug をデバッガとして使用していますが、エラーは報告されていません...お時間をいただきありがとうございます。

function getQuote() {
    // Create the arrays
    quotes = new Arrays(4);
    sources = new Arrays(4);

    // Initialize the arrays with quotes
    quotes[0]  = "When I was a boy of 14, my father was so " + "ignorant...but when I got to be 21, I was astonished " + "at how much he had learned in 7 years.";
    sources[0] = "Mark Twain";
    quotes[1]  = "Everybody is ignorant. Only on different " + "subjects.";
    sources[1] = "Will Rogers";
    quotes[2]  = "They say such nice things about people at " + "their funerals that it makes me sad that I'm going to " + "miss mine by just a few days.";
    sources[2] = "Garrison Keilor";
    quotes[3]  = "What's another word for thesaurus?";
    sources[3] = "Steven Wright";

    // Get a random index into the arrays
    i = Math.floor(Math.random() * quotes.length);

    // Write out the quote as HTML
    document.write("<dl style='background-color: lightpink'>\n");
    document.write("<dt>" + "\"<em>" + quotes[i] + "</em>\"\n");
    document.write("<dd>" + "- " + sources[i] + "\n");
    document.write("<dl>\n");
}
4

2 に答える 2