/    Sign up×
Community /Pin to ProfileBookmark

Breaking Up A Quotation

I am using a random quote script. In each quote I use I would like to give credit to the author. How do I break up the text string so the author is always on the last line?

Example:

“The trouble with the world is that the stupid are cocksure and the intelligent full of doubt. —Betrand Russell”

I would like to have the author on the last line:

“The trouble with the world is that the stupid are cocksure and the intelligent full of doubt.

—Betrand Russell”
————————————————————–

Source (I am adding quotes with authors):

!– ONE STEP TO INSTALL RANDOM LIFE QUOTE:

  • 1. Add the specified code into the BODY of your HTML document –>
  • <!– STEP ONE: Put this code into the BODY of your HTML document –>

    <BODY>

    <CENTER>
    <SCRIPT LANGUAGE=”JavaScript”>

    <!– This script and many more are available free online at –>
    <!– The JavaScript Source!! [url]http://javascript.internet.com[/url] –>

    <!– Begin
    var howMany = 41
    var quote = new Array(howMany+1)
    quote[0]=”Force, and fraud, are in war the two cardinal virtues.”
    quote[1]=”War is the great scavenger of thought.”
    quote[2]=”War is the supreme drama of a completely mechanized society.”
    quote[3]=”The quickest way of ending a war is to lose it.”
    quote[4]=”Anyone who has ever looked into the glazed eyes of a soldier dying on the battlefield will think hard before starting a war.”
    quote[5]=”There is nothing so subject to the inconstancy of fortune as war.”
    quote[6]=”War is regarded as nothing but the continuation of politics by other means.”
    quote[7]=”It takes twenty years or more of peace to make a man; it takes only twenty seconds of war to destroy him.”
    quote[8]=”I’m trying to die correctly, but it’s very difficult, you know.”
    quote[9]=”All men think all men mortal, but themselves.”
    quote[10]=”Life yields only to the conqueror. Never accept what can be gained by giving in. You will be living off stolen goods, and your muscles will atrophy.”
    quote[11]=”I dream, therefore I exist.”
    quote[12]=”Society often forgives the criminal; it never forgives the dreamer.”
    quote[13]=”He who sleeps half a day has won half a life.”
    quote[14]=”While the doctors consult, the patient dies.”
    quote[15]=”Friends are like fiddle strings, they must not be screwed too tight.”
    quote[16]=”A friend to all is a friend to none.”
    quote[17]=”The calmest husbands make the stormiest wives.”
    quote[18]=”The shortest answer is doing.”
    quote[19]=”To talk without thinking is to shoot without aiming.”
    quote[20]=”When the sword of rebellion is drawn, the sheath should be thrown away.”
    quote[21]=”The mob has many heads but no brains.”
    quote[22]=”Speak not of my debts unless you mean to pay them.”
    quote[23]=”A blind man will not thank you for a looking-glass.”
    quote[24]=”He that is born to be hanged shall never be drowned.”
    quote[25]=”A country can be judged by the quality of its proverbs.”
    quote[26]=”Flattery makes friends and truth makes enemies.”
    quote[27]=”Life without a friend is death without a witness.”
    quote[28]=”Translators, traitors.”
    quote[29]=”If a man deceives me once, shame on him; if he deceives me twice, shame on me.”
    quote[30]=”The nail that sticks up will be hammered down.”
    quote[31]=”There are many paths to the top of the mountain, but the view is always the same.”
    quote[32]=”Do not use a hatchet to remove a fly from your friend’s forehead.”
    quote[33]=”Of all the thirty-six alternatives, running away is best.”
    quote[34]=”There is hope from the sea, but none from the grave.”
    quote[35]=”When the apple is ripe it will fall.”
    quote[36]=”Marry a mountain girl and you marry the whole mountain.”
    quote[37]=”Life is a bridge. Cross over it, but build no house on it.”
    quote[38]=”It is better to sit down than to stand, it is better to lie down than to sit, but death is the best of all.”
    quote[39]=”If your buttocks burn, you know you have done wrong.”
    quote[40]=”A wise man hears one word and understands two.”
    quote[41]=”The course of true love never did run smooth.”
    function rndnumber(){
    var randscript = -1
    while (randscript < 0 || randscript > howMany || isNaN(randscript)){
    randscript = parseInt(Math.random()*(howMany+1))
    }
    return randscript
    }
    quo = rndnumber()
    quox = quote[quo]
    document.write(quox)
    // End –>
    </SCRIPT>
    </CENTER>

    <p><center>
    <font face=”arial, helvetica” size=”-2″>Free JavaScripts provided<br>
    by <a href=”http://javascriptsource.com”>The JavaScript Source</a></font>
    </center><p>

    <!– Script Size: 3.69 KB –>

    to post a comment
    JavaScript

    1 Comments(s)

    Copy linkTweet thisAlerts:
    @khalidali63Jan 10.2003 — From your example

    "The trouble with the world is that the stupid are cocksure and the intelligent full of doubt. ---Betrand Russell"

    just add "<br>" tag right before the authors name,as in your example above after making change it will look like this

    "The trouble with the world is that the stupid are cocksure and the intelligent full of doubt. <br>Betrand Russell"

    the above line will print qoute in one line and Bertrand Russell in second line.

    Khalid
    ×

    Success!

    Help @mbrovage spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...