JSCboulder
Technical User
I have a simple script which is randomly getting and writing text from 16 chunks of text. It's pasted below. It writes all of them except one - the last one, #16, and I can't find out why... I've already zapped germlins out of the text. Anyone see why the last line only gives this error:
undefined
?
thanks
JSC
script: (writes to a defined div)
var myquotes = new Array ();
myquotes[1]="<span>Man has nothing else to do but surrender in deep trust, in deep love. Dont be a doer, just surrender. Let there be a let go.</span> - Osho";
myquotes[2]="<span>Meditation is possible only when you are unmotivated, you dont have any desire. When there is no desire, there is meditation. Meditation is a state of desirelessness.</span> - Osho";
myquotes[3]="<span>That\'s what meditation is - just getting beyond the mind and beyond time, and you have entered into eternal silence, into eternal life.</span> - Osho";
myquotes[4]="<span>The mind is constantly talking. If the inner talk can drop even for a single moment you will be able to have a glimpse of no-mind. That\'s what meditation is all about.</span> - Osho";
myquotes[5]="<span>Meditation is a way of settling in oneself, at the innermost core of your being. Once you have found the center of your existence, you will have found both roots and wings.</span> - Osho";
myquotes[6]="<span>You cannot desire meditation, because meditation happens only when there is no desire.</span> - Osho";
myquotes[7]="<span>Whenever some bliss happens, trust it, and go in that direction. If you can follow bliss, you will never go astray, you will be following nature.</span> - Osho";
myquotes[8]="<span>My whole approach towards life is that of total acceptance, is that of celebration, not of renunciation.</span> - Osho";
myquotes[9]="<span>Life is a celebration because it is an adventure.</span> - Osho";
myquotes[10]="<span>I am neither for anything, nor against anything. My whole approach is that you should find a deep, relaxed contentment with yourself and existence.</span> - Osho";
myquotes[11]="<span>Faith is dangerous, never cheap. You will have to put your whole life at stake. It needs courage, but only a courageous person can be religious.</span> - Osho";
myquotes[12]="<span>Meditation is just a courage to be silent and alone.</span> - Osho";
myquotes[13]="<span>Unless a man learns how to create, he never becomes a part of existence, which is constantly creative. By being creative one becomes divine; creativity is the only prayer.</span> - Osho";
myquotes[14]="<span>To know life in its insecurity is to know life in its immense beauty, is to know life in its authenticity.</span> - Osho";
myquotes[15]="<span>From birth to death man is a long sleep, sometimes dreaming with eyes closed, sometimes dreaming with eyes open, but dreaming all the same, all the time.</span> - Osho";
myquotes[16]="<span>Those otherworldly desires were just as foolish as the worldly desires.</span> - Osho";
var i = Math.floor(16*Math.random())
document.write(myquotes);
undefined
?
thanks
JSC
script: (writes to a defined div)
var myquotes = new Array ();
myquotes[1]="<span>Man has nothing else to do but surrender in deep trust, in deep love. Dont be a doer, just surrender. Let there be a let go.</span> - Osho";
myquotes[2]="<span>Meditation is possible only when you are unmotivated, you dont have any desire. When there is no desire, there is meditation. Meditation is a state of desirelessness.</span> - Osho";
myquotes[3]="<span>That\'s what meditation is - just getting beyond the mind and beyond time, and you have entered into eternal silence, into eternal life.</span> - Osho";
myquotes[4]="<span>The mind is constantly talking. If the inner talk can drop even for a single moment you will be able to have a glimpse of no-mind. That\'s what meditation is all about.</span> - Osho";
myquotes[5]="<span>Meditation is a way of settling in oneself, at the innermost core of your being. Once you have found the center of your existence, you will have found both roots and wings.</span> - Osho";
myquotes[6]="<span>You cannot desire meditation, because meditation happens only when there is no desire.</span> - Osho";
myquotes[7]="<span>Whenever some bliss happens, trust it, and go in that direction. If you can follow bliss, you will never go astray, you will be following nature.</span> - Osho";
myquotes[8]="<span>My whole approach towards life is that of total acceptance, is that of celebration, not of renunciation.</span> - Osho";
myquotes[9]="<span>Life is a celebration because it is an adventure.</span> - Osho";
myquotes[10]="<span>I am neither for anything, nor against anything. My whole approach is that you should find a deep, relaxed contentment with yourself and existence.</span> - Osho";
myquotes[11]="<span>Faith is dangerous, never cheap. You will have to put your whole life at stake. It needs courage, but only a courageous person can be religious.</span> - Osho";
myquotes[12]="<span>Meditation is just a courage to be silent and alone.</span> - Osho";
myquotes[13]="<span>Unless a man learns how to create, he never becomes a part of existence, which is constantly creative. By being creative one becomes divine; creativity is the only prayer.</span> - Osho";
myquotes[14]="<span>To know life in its insecurity is to know life in its immense beauty, is to know life in its authenticity.</span> - Osho";
myquotes[15]="<span>From birth to death man is a long sleep, sometimes dreaming with eyes closed, sometimes dreaming with eyes open, but dreaming all the same, all the time.</span> - Osho";
myquotes[16]="<span>Those otherworldly desires were just as foolish as the worldly desires.</span> - Osho";
var i = Math.floor(16*Math.random())
document.write(myquotes);