Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 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
    Regular Coder
    Join Date
    Jun 2002
    Location
    Atlanta, GA.
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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]

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •