Web Analytics Made Easy -
StatCounter :: Random Content Script Doesnt work :: - CodingForum

Announcement

Collapse
No announcement yet.

:: Random Content Script Doesnt work ::

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • :: Random Content Script Doesnt work ::

    Im using this script for random content
    <script language="JavaScript">
    <!--

    /*
    Random Content Script- By JavaScript Kit(http://www.javascriptkit.com)
    Over 200+ free JavaScripts here!
    */

    function random_content(){
    var mycontent=new Array()
    //specify random content below.
    mycontent[1]='Wind Whispers violent threats<br>shivering soul, their desires in debt<br>hells grasp on my soul and mind<br>Satan's intentions are not kind<br>Heaven's glory doesn't remain<br>inside my mind I'm going insane<br>my silent scream, with on sound<br>To hell's gate is where I'm bound'
    mycontent[2]='content'
    mycontent[3]='content'
    mycontent[4]='content'
    mycontent[5]='content'


    var ry=Math.floor(Math.random()*mycontent.length)
    if (ry==0)
    ry=1
    document.write(mycontent[ry])
    }
    random_content()
    //-->
    </script>

    and i have the first conent all on one line but it doesnt show up, nothing does, when i shorten it(like take away 90%) it works

    i need a script where i can add as much as i want

    help!

    thanks
    n

  • #2
    Try using double quotes for the messages.

    mycontent[1]="Wind Whispers violent threats<br>shivering soul, their desires in debt<br>hells grasp on my soul and mind<br>Satan's intentions are not kind<br>Heaven's glory doesn't remain<br>inside my mind I'm going insane<br>my silent scream, with on sound<br>To hell's gate is where I'm bound";
    mycontent[2]="content";
    mycontent[3]="content";
    mycontent[4]="content";
    mycontent[5]="content";
    The answer does not come from thinking outside the box, it comes from realizing the truth :-
    "There Is No Box". [JavaScript Gadgets'n'Gizmos][JavaScript-FX]

    Comment


    • #3
      thanks!

      Comment

      Working...
      X