SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Blank screen

  1. #1
    Skills to Pay the Bills Sparkie's Avatar
    Join Date
    Jul 1999
    Location
    A cave with 47 computers and an internet feed
    Posts
    3,559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Blank screen

    There must be an apostrophe or some other little javascript nuisance that I'm still including in this script, but whenever I try it out, nothing shows..it is supposed to randomly display some text and a link..but I see nothing! Help !!!!




    <script>

    var totallinks=6

    var urls=new Array(totallinks)
    var descriptions=new Array(totallinks)
    var titles=new Array(totallinks)

    urls[0]="http://www.pawsitronic.com/"
    descriptions[0]="Professional and creative website design and internet marketing services.<p>

    Give your visitors much more than just a website, give them a complete web experience by powering

    up your site with a creative design by Pawsitronic! Leave your mark on the web by visiting us

    today!"
    titles[0]="Pawsitronic Web Design"

    urls[1]="http://www.templatepro.com/"
    descriptions[1]="Want a professional website but dont want to wade through the technical jargon

    or waste money on unskilled designers?<p>
    Then look no further than Template Pro. With hundreds of complete, customizable templates

    available for businesses and organizations, we are your one-stop template shop!"
    titles[1]="TemplatePro"

    urls[2]="http://www.pouncehost.com/"
    descriptions[2]="Empower your business by leaps and bounds with PounceHost!<p>
    Our feature-packed hosting services grow with your website, and our professional PouncePanel

    helps you easily manage your account, settings, email, and much more! Unleash yourself with

    PounceHost!"
    titles[2]="PounceHost Internet Services"

    urls[3]="http://www.mascotartist.com/"
    descriptions[3]="Studies show that incorporating a mascot into your business can help build

    branding and promote customer awareness of your products and services!<p>
    A unique character from MascotArtist.com is the perfect solution to keep your visitors and

    customers coming back to your site again and again!"
    titles[3]="MascotArtist - Where a Picture is Worth a Thousand Words"

    urls[4]="http://www.improvium.com/"
    descriptions[4]="Get award-winning tips, tricks and promotion strategies to build your web

    presence online!<p>
    You wont find this information available anywhere else for such a small price! Unique insights,

    invaluable ideas and helpful guides to marketing your site are just a click away!"
    titles[4]="Improvium - The Element of Success"

    urls[5]="http://www.translateto.com"
    descriptions[5]="Reach a global audience with our reliable and affordable website translation

    services.<p>
    Multiple languages, accurate translations and unparalleled customer service help promote your

    products and services across borders and boundaries worldwide! "
    titles[5]="TranslateTo dot com"

    urls[6]="http://www.fontfuel.com"
    descriptions[6]="Dazzle your visitors with high-quality fonts, perfect for use in desktop

    publishing, web development, graphic design and much more! Attractive designs and numerous

    categories help you find the right font for the job - every time!"
    titles[6]="FontFuel Industries"

    var MachoManRandomSavage=Math.floor(Math.random()*totallinks)
    </script>

    <script>
    var cont=titles[MachoManRandomSavage]+"<br>"+descriptions[MachoManRandomSavage]
    cont+="<br><a href='"+urls[MachoManRandomSavage]+"'>"
    cont+=urls[MachoManRandomSavage]+"</a><br>"
    document.write(cont)
    </script>

  2. #2
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know the answer. Some thoughts:

    Since you're using MachoManRandomSavage in two different sets of script tags, is it possible that its getting lost?

    If you are trying to write this out to a the page, perhaps you could do it in the same function where you build the arrays and initially declare MachoManRandomSavage. Put a set of DIV tags in the body of your page and then try this:

    Code:
    <script> 
    
    var totallinks=6 
    
    var urls=new Array(totallinks) 
    var descriptions=new Array(totallinks) 
    var titles=new Array(totallinks) 
    
    urls[0]="http://www.pawsitronic.com/" 
    descriptions[0]="Professional and creative website design and internet marketing services.<p> 
    
    Give your visitors much more than just a website, give them a complete web experience by powering 
    
    up your site with a creative design by Pawsitronic! Leave your mark on the web by visiting us 
    
    today!" 
    titles[0]="Pawsitronic Web Design" 
    
    urls[1]="http://www.templatepro.com/" 
    descriptions[1]="Want a professional website but dont want to wade through the technical jargon 
    
    or waste money on unskilled designers?<p> 
    Then look no further than Template Pro. With hundreds of complete, customizable templates 
    
    available for businesses and organizations, we are your one-stop template shop!" 
    titles[1]="TemplatePro" 
    
    urls[2]="http://www.pouncehost.com/" 
    descriptions[2]="Empower your business by leaps and bounds with PounceHost!<p> 
    Our feature-packed hosting services grow with your website, and our professional PouncePanel 
    
    helps you easily manage your account, settings, email, and much more! Unleash yourself with 
    
    PounceHost!" 
    titles[2]="PounceHost Internet Services" 
    
    urls[3]="http://www.mascotartist.com/" 
    descriptions[3]="Studies show that incorporating a mascot into your business can help build 
    
    branding and promote customer awareness of your products and services!<p> 
    A unique character from MascotArtist.com is the perfect solution to keep your visitors and 
    
    customers coming back to your site again and again!" 
    titles[3]="MascotArtist - Where a Picture is Worth a Thousand Words" 
    
    urls[4]="http://www.improvium.com/" 
    descriptions[4]="Get award-winning tips, tricks and promotion strategies to build your web 
    
    presence online!<p> 
    You wont find this information available anywhere else for such a small price! Unique insights, 
    
    invaluable ideas and helpful guides to marketing your site are just a click away!" 
    titles[4]="Improvium - The Element of Success" 
    
    urls[5]="http://www.translateto.com" 
    descriptions[5]="Reach a global audience with our reliable and affordable website translation 
    
    services.<p> 
    Multiple languages, accurate translations and unparalleled customer service help promote your 
    
    products and services across borders and boundaries worldwide! " 
    titles[5]="TranslateTo dot com" 
    
    urls[6]="http://www.fontfuel.com" 
    descriptions[6]="Dazzle your visitors with high-quality fonts, perfect for use in desktop 
    
    publishing, web development, graphic design and much more! Attractive designs and numerous 
    
    categories help you find the right font for the job - every time!" 
    titles[6]="FontFuel Industries" 
    
    var MachoManRandomSavage=Math.floor(Math.random()*totallinks) 
    
    
    var cont=titles[MachoManRandomSavage]+"<br>"+descriptions[MachoManRandomSavage] 
    cont+="<br><a href='"+urls[MachoManRandomSavage]+"'>" 
    cont+=urls[MachoManRandomSavage]+"</a><br>" 
    
    divYourStuff.innerHTML = cont;
    
    </script>
    
    ---
    
    <div id="divYourStuff"></div>
    Last edited by makeda; Apr 5, 2002 at 12:27.

  3. #3
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not sure of the situation you are getting the blank screen but your code worked find for me. However a couple of things I can make note on

    document.write("") can not span multiple lines. All of the information has to exist on one line. This can get very long but that is the way it must be. Once I put all of the information you had on one line everything worked fine.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.


Bookmarks

Posting Permissions

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