The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> Text Change Upon Refresh?, i'm a noob, i know
post Aug 3 2013, 11:23 PM
Post #1

Group: Members
Posts: 2
Joined: 31-July 13
Member No.: 19,495


I'm trying to figure out some way to have text in a tumblr description box change whenever someone comes onto my blog or refreshes it. I discovered this but it's for images... How can I do the same except with text?

Thank you so much in advance!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
post Aug 4 2013, 12:10 AM
Post #2

Programming Fanatic

Group: Members
Posts: 1,735
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088

Well, how about something like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>Random Text</title>
<script language="JavaScript" type="text/javascript">// <![CDATA[
// <![CDATA[
function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="This is text1."
myimages[2]="This is text2."
myimages[3]="This is text3."
myimages[4]="This is text4."
myimages[5]="This is text5."
myimages[6]="This is text6."

var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
// ]]]]><![CDATA[>
// ]]></script>

This is only a down and dirty sample and I placed the code inside a <div>, which you may or may not need. I'm sure you will need to do some more work on it to fit your needs (hey, I'm not going to do all the work biggrin.gif ). Also, if the user has javascript turned off then you should also have a <noscript> section to display some default text.

Hope this helps,


This post has been edited by CharlesEF: Aug 4 2013, 12:21 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


- Lo-Fi Version Time is now: 11th July 2020 - 10:29 AM