Random Quotes!

I was going through my quotes trying to come up with idea for the next t-shirt, when I had the idea to put them in a list with a link to the post they came from. So now, at the top of the page, there will be random quotes from my posts. Since I just thought of it last night, I only have 28 right now, but, as soon as I have time, I’ll add so many that you’ll never be able to see them all, no matter how much you reload. Muh ha ha ha!
I have a few problems, though. I don’t know how to put regular quotes (“) in those quotes and have to use single quotes instead. Also, as has been a problem with my page for a long time, the color for links is just to dark to go against the blackground. I just don’t know how to use one color for in the post and another for on the sidebar. Anyone know a line I can add to this part to separately set the link color for my sidebar?
.side {
font-family:verdana, arial, sans-serif;
color:#555;
font-size:12px;
font-weight:normal;
background:#000;
line-height:14px;
padding:2px;
}
Anyhoo, if you want quotes on your site you can add this to your template:
<script type=”text/javascript” src=”http://www.imao.us/docs/quotes.txt”></script>
UPDATE: Got answers to most my questions, but I really need to find out how to change the link color for just my sidebar; that’s a problem that plagued my website for sometime now.

No Comments

  1. Yeah I noticed this last night while you were still working on it and made a few adjustments to it, but by the time I had finished and emailed it to you, you had updated and fixed the script so that you didn’t need my fix.
    Luckily the email bounced due to the attachment being a .js file (the default javascript format) so I didn’t embarrass myself.
    If you’re interested I can make you one which is easier to update than the one you have now.
    To use quotation marks inside of a string you have to escape them.
    var text = “He said, \”Hello.\””;
    alert(text);
    would print
    ->He said, “Hello.”Yeah I noticed this last night while you were still working on it and made a few adjustments to it, but by the time I had finished and emailed it to you, you had updated and fixed the script so that you didn’t need my fix.
    Luckily the email bounced due to the attachment being a .js file (the default javascript format) so I didn’t embarrass myself.
    If you’re interested I can make you one which is easier to update than the one you have now.
    To use quotation marks inside of a string you have to escape them.
    var text = “He said, \”Hello.\””;
    alert(text);
    would print
    ->He said, “Hello.”<-

  2. You could probably get double-quotes into your random quotes by using &quot; Like this:
    text[1] = “My friend Charlie O’Toole said &quot;Hello&quot.“;
    But a better solution is to probably put the entire text block into single-quotes (instead of double-quotes), then just precede a single-quote with a backslash whenever you need an actual single-quote character. Like this:
    text[1] = ‘My friend Charlie O\’Toole said “Hello”.‘;

  3. Chack your email – I sent you something like this:
    Use your .side class to further specify your anchor tag attributes. You may have to include a class=”side” in your a tags but something like this should work:
    a.side
    {
    color: #000080;
    background: #ffffff;
    text-decoration: underline;
    }
    a.side:visited
    {
    color: #000080;
    background: #ffffff;
    }
    a.side:hover
    {
    color: #000066;
    background: #dddddd;
    text-decoration: underline;
    font-weight: bold;
    }

  4. Well you can make the number of quotes self counting for instance.
    That way you can just drop them in cookie cutter like.
    var text = new Array();
    var i = 0;
    //BLANK TO COPY AND PASTE –> text = ““;
    text = “Guns Are Like Art, Except Not Useless“;
    text = “Note to self: when asking, ‘What would Jesus do?’ remember that the answer is sometimes ‘Freak out and knock over tables.’“;
    text = “My God, how many countries are there?“;
    text = “Yes, it’s funny to laugh at Streisand, but do those who encourage her to speak out ever stop to think of her feelings? She is a human being, and, if they had any concern for her, the would lock her away in a home and train her to keep quiet through a series of painful shocks.“;
    text = “Depite his enourmous head and the fact that he talks funny, Kennedy still has some pull in the Senate, due probably to the fear from other Senators that he might eat them, offer them a ride home, or, worst of all, headbutt them.“;
    text = “Anyway, when the U.S. government gets serious on this assassinate Saddam thing, they have my e-mail. My rates for heads of state are a bit higher, but I will give a patriotic discount. Frank’s gots to eat, though, and he likes the prime rib.“;
    //SNIP[…]
    document.write(text[Math.floor((text.length-1) * Math.random())]);
    See that set creates its own set of numbers so you don’t have to keep writing text[28], text[29], text[30], ect… for each entry.
    This will work all the way up till 1.79E+308 entries.
    So… don’t put too many funny quotes in there.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.