WeCodeThings Library
Library of code bits
Glossary
Contact Us
Need a web designer? visit
WeCodeThings.Com
for more details
Search
Browse by Category
..... ColdFusion
.......... Helpful Functions
..... CSS
..... Flex
..... HTML
..... JavaScript
..... JQuery
..... PHP
..... SEO
..... SQL
.......... Oracle
WeCodeThings Library
ColdFusion
Helpful Functions
CSS
Flex
HTML
JavaScript
JQuery
PHP
SEO
SQL
WeCodeThings Library
.:
ColdFusion
.:
How to display Random Quote using ColdFusion and the RandRange Function
How to display Random Quote using ColdFusion and the RandRange Function
<!--- Be sure to change the 3 in - #RandRange(1, 3)# to match how many quotes you have --->
<!--- *************** No Appostrophy's in quoted text **********************************
****************************************************************************************
************************************EXAMPLE*********************************************
*************** GOOD: I dont like this text. ******************************************
*************** BAD : I don't like this text. ****************************************** --->
<!--- Set random quotes here, separate each quote with a comma --->
<cfset
Quotes
=
"This is random quote 1, This is random quote 2, This is random quote 3"
>
<cfset
randomQuote
=
#RandRange
(
1
,
3
)
#>
<cfset
displayQuote
=
#trim
(
listGetAt
(
Quotes, randomQuote
)
)
#>
<script language=
"javascript"
>
function
showtext
(
id,place
)
{
d=document.
getElementById
(
id
)
;
d.
innerHTML
=place;
}
</script>
<!--- BODY --->
<map
name
=
"Map"
id
=
"Map"
>
<area
shape
=
"rect"
coords
=
"60,126,115,210"
href
=
"#"
alt
=
"Random Quote"
onMouseOver
=
"showtext
('thetext','<cfoutput>
#displayQuote#
</cfoutput>
')" onMouseOut="showtext('thetext','')" />
Article
002
Created
4-7-2009
Modified
6-5-2009
Author
WeCodeThings
Rating
(None)
Email
Print
Add Comment
How helpful was this article to you?
5 - Very Helpful
4
3 - Somewhat Helpful
2
1 - Not Helpful
Related Articles
Flex 3 Get Data from a CFC ColdFusion using bindable result handler function
More about creating a remote object and...
(No rating) 4-21-2009 Views: 888
PHP Mail Function Multiple Emails, People, To, or Recipients in Email PHP
When constructing the mail function with...
5-27-2009 Views: 889
How to include a file with PHP using the includes and require function
The include() Function Simplest way to...
(No rating) 4-10-2009 Views: 417
User Comments
Add Comment
No comments have been posted.
.: Powered by Lore .:Code by
WeCodeThings Website Design and Development