Home >Web Front-end >JS Tutorial >JavaScript script that randomly displays classic sentences or poems_javascript techniques

JavaScript script that randomly displays classic sentences or poems_javascript techniques

WBOY
WBOYOriginal
2016-05-16 19:11:042382browse
Copy code The code is as follows:

Random poem:                                                                             ]



shi.js

Copy code The code is as follows:

function text() {
};

text = new text();
number = 0;

// textArray
text[ number ] = "The heart is right, the mind is right, the thoughts are right, the body is right, the eyes are right, and the walk is right. Only in the last days can we be able to do anything right."
text[number] = "The knowledge in the world is all small skills, but the real profoundness is the Buddha's teaching. "
text[number] = "For thousands of years, Truthfulness, Compassion, and Forbearance have been the only standards for measuring good and bad. Everyone should abide by them. "
text[number ] = "Unintentional means it is fate. It is accidental. It's inevitable. No matter where the guest comes from, this website is opened for the sake of fate. "The world has lasted for eternity, and how many years have passed since it has been reincarnated?" , Opportunities are constantly being sought. -Google English"
text[number] = "I am becoming more and more refined in my practice of inaction, and I truly feel that no one will benefit from my good thoughts."
text[number] = "The years are so long, who are the endless reincarnations of the world? Today, I came here by chance, and the dust-covered memories are opened here."
text[number] = "How can we save all sentient beings when the world becomes dark for a day? The truth is revealed. In the future, when the law in the world is upright, I will be a fairy when I wave my sleeves and walk through the clouds. "
text[number] = "People should calm down their bodies, walk in their posture, and be at ease with the situation, then their mind will be peaceful and their spirit will be relaxed. Zhang Sanfeng"
text[number] = "Things are dusty outside the window, and the body is dreaming in the window. Knowing that the body is a dream, everything is just like dust." Yu Mian. There is nothing wrong with my eyebrows, but there are thousands of years left in my writing. "The past has passed, and there is no need to think about the future. The only thing I can say is the present sentence. When the plums are ripe, the gardenia will be fragrant." [number] = "My eyes are empty, the lake and the sea are full of clouds, and the outstanding forest is like no other. Who am I in the past and present? I have to be merciful and merciful."
text[number] = "The bottom of the ten thousand-foot cold pool is clear, and the Jinlin Night is clear. Walking quietly towards the light. When the pole is hooked, the moon is shining brightly on the water. Spring comes after spring, and the weeds and mountain flowers are new again at dawn. The moon is not moved by the clock. Mingfei is a night traveler. "
text[number] = "The whole world is full of fame and wealth, and I wake up alone in the Tao. I will see that I will fly up and break through the autumn sky."
text[number] = "When you come, you leave without a trace, and when you go, you go with the same events. Why bother asking about the incident?" This floating life is just a dream. "
text[number] = "Like water, like clouds, a dream body, I don't know what else is more intimate. No other things are allowed in it, and it is distributed to people on Huangmei Road. "
text[number] = "Flowers are not flowers, fog is not fog. It comes at midnight and goes away at dawn. It comes like a spring dream, but it goes away like a morning cloud with nowhere to go. "
text[number ] = "Practice until your body looks like a crane, with two scriptures under a thousand pine trees. I came to ask and Wuyu said, the clouds are in the blue sky and the water is in the bottle. "
text[number] = "Don't laugh at the dusty face that is full of sickness, this life is always there. The rolled lotus leaves are hard to get wet in the end, and it is a kind of leisure to live in the heart of the clouds. "
text[number] = "What's the matter with the snail's horns? This life is reflected in the light of the stone fire. Follow poverty, follow wealth, and follow joy. If you don't smile, you are an idiot. "
text[number] = "The vast sky wind blows all over the building, and the clouds in the peaks surge into Linqiu. The sound of rain falls at noon, and there are bells and bells on the eaves. The abbot Xiao Ran is in the autumn courtyard. - Passing Yue Yun Tower in Qingqiu·Qiu Changchun"
text[number] = "My heart is like the sound of bells on a snowy night, and looks like a Meg on a frosty day. Walking leisurely in the depths of white clouds, I know that the immortal's home is relaxing. —Gift from ·Zhang Ziqiong"
text[number] = "The world is as big as a beautiful pot, and a husband is making a decision. It's late spring in Chang'an, where there's wind and rain, and the ground is covered with fallen flowers. - Guanzhong Tage Couplet·Han, Lan, Cao, He"
text[number] = "If you want to become a pure and beautiful character, you must be forged in the fire; if you want to accomplish deeds that can shake up the heaven and earth, you must go to the Walking on thin ice. ——Cai Gen Tan"
text[number] = "Put away the dusty atmosphere of the world, and there will be no fire and ice in my chest; I will eliminate the stinginess in my heart, and the moon will come and the wind will come from time to time in front of my eyes. ——Cai Gen Tan"
text[number] = "Since I am a great smelter, why should I worry about the impossibility of molten gold and blunt iron? If we are like the giant sea and the Yangtze River, why should we worry about the cross currents and pollution that cannot be accommodated? ——Cai Gen Tan"
text[number] = "If you want to face changes without being in a hurry, you must always think about it and stay calm; if you want to die without greed, you must take everything in life lightly. ——Cai Gen Tan"
text[number] = "When you are rescued at any time, it is like a gentle breeze that can dissipate the heat; you can be refined from the vulgar world, like the pale moon reflecting the light clouds. —Cai Gen Tan"
text[number] = "If you look directly at the end of fame and wealth, you will be greedy and despise yourself; if you are in trouble and poverty, look at the origin directly from the beginning, then your resentment will cease. —Cai Gen Tan"
text[number] = "Observe things moving in silence, and watch people busy in idle places, so that you can have an extraordinary and refined taste; when you are in a busy place, you will take a break, and you can find tranquility in the noisy place, which is to settle down and live your life. of work. —Cai Gen Tan"
text[number] = "When nothing happens, it is as if nothing happens. Only by being alert can unexpected changes be avoided. When things are as common as nothing, then calmness can eliminate the danger in the situation. ——Cai Gen Tan"
text[number] = "If you hold your body like the nine tripods of Mount Tai and remain motionless, you will feel less embarrassed; when things happen, if they pass by slowly like flowing water and falling flowers, you will have a lot of fun.——Cai Gen Tan"
text[number] = "When encountering problems, he only remains calm and calm, no matter how complicated things are, he will be ready in the end; he treats others without any pretense or deceit, even though he is as cunning as a mountain ghost, he is also sincere. —Cai Gen Tan"
text[number] = "In the dream, there is gold and jade hanging, and everything is realistic. Even if it is true when you fall asleep, it will be false when you wake up. In your spare time, you perform verses and talk about the original meaning. The words are very similar, although they are said at the wrong time. —Cai Gen Tan"
text[number] = "Honour and disgrace have the same root. If you are tired of humiliation, why seek honor? Life and death have the same root. If you are greedy for life, you don't have to be afraid of death. —Cai Gentan"
//keep adding items here...

increment = Math.floor(Math.random() * number);

document.write(text[increment ]);