Thomas Tullis
New member
Hi, I am using webs.com site builder to code a site (www.TroyAndAbed.tk). It is a quote site for NBC's "COmmunity" tv show. I need help with a random quote generator. I got the following one to work.:
_______________start code
<style>
.row
{
padding-left:10px;background-color:white;
font-family: verdana, san-serif;font-size: 13px
}
</style>
< !-- Script by hscripts.com -->
<script type="text/javascript">
var arr= new Array();
arr.push("Your Quote1");
arr.push("Your Quote2");
arr.push("Your Quote1");
function rotate()
{
var num= Math.round(Math.random()*3);
add(num);
}
function add(i)
{
var chi = document.createTextNode(arr);
var tab1 = document.getElementById("add1");
while(tab1.hasChildNodes())
{
tab1.removeChild(tab1.firstChild);
}
tab1.appendChild(chi);
}
</script>
< !-- Script by hscripts.com -->
<table align=center style="background-color:#C0C0C0";>
<tr><td background-color:#C0C0C0 align=center width=300 style="font-family:Times New Roman;"><b>Random Quote Generator</td></tr>
<tr><td id=add1 class=row width=300 align=center>Click Next to Display Random message</td></tr>
<tr><td align=center><input type=button value="Next" border=0 onclick="rotate()"></td></tr></table>
_________________end code
But whenever I I copy and paste the quotes I want to use into the "Your Quote 1" "Your Quote 2" etc. area, the code stops working. When I type them out it works. Can I not copy and paste document rich text into this html? Does anyone have a random quote generator that I can modify to fit my own copy pasted quotes? Any help you have would be great. thanks.
_______________start code
<style>
.row
{
padding-left:10px;background-color:white;
font-family: verdana, san-serif;font-size: 13px
}
</style>
< !-- Script by hscripts.com -->
<script type="text/javascript">
var arr= new Array();
arr.push("Your Quote1");
arr.push("Your Quote2");
arr.push("Your Quote1");
function rotate()
{
var num= Math.round(Math.random()*3);
add(num);
}
function add(i)
{
var chi = document.createTextNode(arr);
var tab1 = document.getElementById("add1");
while(tab1.hasChildNodes())
{
tab1.removeChild(tab1.firstChild);
}
tab1.appendChild(chi);
}
</script>
< !-- Script by hscripts.com -->
<table align=center style="background-color:#C0C0C0";>
<tr><td background-color:#C0C0C0 align=center width=300 style="font-family:Times New Roman;"><b>Random Quote Generator</td></tr>
<tr><td id=add1 class=row width=300 align=center>Click Next to Display Random message</td></tr>
<tr><td align=center><input type=button value="Next" border=0 onclick="rotate()"></td></tr></table>
_________________end code
But whenever I I copy and paste the quotes I want to use into the "Your Quote 1" "Your Quote 2" etc. area, the code stops working. When I type them out it works. Can I not copy and paste document rich text into this html? Does anyone have a random quote generator that I can modify to fit my own copy pasted quotes? Any help you have would be great. thanks.