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 7 of 7
  1. #1
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post

    newbie script doesn't work

    I found this neat script and it won't work. I ran it through Fire Fox debugger and had all kinds of errors I new nothing about. From the browser versions in the script, it might be old.
    The attached doc is a html.


    Would some kind soul look at it for me.

    All help appreciated.
    Attached Files Attached Files
    Last edited by rob86; 07-10-2007 at 03:52 PM.

  • #2
    New Coder
    Join Date
    Apr 2006
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What script are you talking about??? I don't see anything.

  • #3
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post

    partially works now.

    The script won't run in IE.

    If I make the text message longer, the script gives a blank page.

    The file is html
    Attached Files Attached Files

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Just post the script here. I'm not about to download a file just to view a script. Help us help you.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post
    Thanks 4 responding

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <HTML>
    <HEAD>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <TITLE>Title Animations</TITLE>

    <Script Language="Javascript">

    // Script by Lefteris Haritou
    // Copyright ©1998
    // http://www.geocities.com/~lef
    // This Script is free as long
    // as you keep the above credit !

    bname=navigator.appName;
    bversion=parseInt(navigator.appVersion)
    if ((bname=="Netscape" && bversion>=5) || (bname=="Microsoft Internet Explorer" && bversion>=7)){
    if (document.layers){ //if (bname=="Netscape"){
    brows=true
    del=30
    }
    else{
    brows=false
    del=80
    }
    var msg=0;
    var z=0;
    var timer1;
    var message= new Array();
    var color= new Array();
    var values= new Array('-6','-5','-4','-3','-2','-1','+1','+2','+3','+4','+5','+6')
    // Put here your own messages. Add as many as you wan't (Do not edit anything else in the Script except the lines below)

    message[0]='Title Animations'
    color[0]='#FF0000'

    message[1]='A new JavaScript'
    color[1]='#0000FF'

    message[2]='Fully customizable and easy to use'
    color[2]='#FFFF00'

    message[3]='&copy; 1998 Lefteris Haritou'
    color[3]='#FFFFFF'

    message[4]='Netscape 4 and Internet Explorer 4 supported'
    color[4]='#00FF00'


    // Put here your own messages. Add as many as you wan't (Do not edit anything else in the Script except the lines above)

    function $(refId) { return document.getElementById(refId); }
    function start(){
    if ((bname=="Netscape" && bversion>=5) || (bname=="Microsoft Internet Explorer" && bversion>=7)){
    if(z<values.length){
    if (brows){
    document.layers['text'].document.writeln('<P Class="main" Align="Center"><font color="'+color[msg]+'" size="'+values[z]+'" face="Arial"><NOBR>'+message[msg]+'</NOBR></font></P>')
    document.layers['text'].document.close();
    }
    else{
    $("text").innerHTML='<Pre><P Class="main" Align="Center"><font color="'+color[msg]+'" size="'+values[z]+'" face="Arial"><NOBR>'+message[msg]+'</NOBR></font></P></Pre>'
    }
    z++;
    timer1=window.setTimeout('start()',del)
    }
    else
    chg();
    }
    }
    function stop(){
    if ((bname=="Netscape" && bversion>=5) || (bname=="Microsoft Internet Explorer" && bversion>=7))
    window.clearTimeout(timer1);
    window.clearTimeout(timer2);
    }

    function chg(){
    if (brows){
    document.layers['text'].document.writeln('')
    document.layers['text'].document.close();
    }
    else
    $("text").innerHTML='';
    if(msg<message.length-1){
    msg++;
    }
    else
    msg=0;
    z=0;
    timer2=window.setTimeout('start()',1000)
    }
    }

    </Script>
    </HEAD>

    <BODY BGCOLOR="#000000" LINK="#FF0000" VLINK="#FF0000" ALINK="#FFFF00" TEXT="#000000" onLoad="start()" onUnload="stop()">

    <Div id="text" style="position: absolute; left: 30px; top: 80px">
    //</Div>
    //<Layer name="text" left=4 top=80>
    //</Layer>


    <script language="javascript">

    // Returns the browser application name
    // for example, "Microsoft Internet Explorer" or "Netscape"
    document.write(window.navigator.appName);

    // Returns the internal code name of the browser
    // for example, "Mozilla"
    document.write(window.navigator.appCodeName);

    // Returns the version of the browser as a string
    document.write(window.navigator.appVersion);

    // Returns the user agent string for the browser
    document.write(window.navigator.userAgent);

    </script>

    </BODY>
    </HTML>

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    While yes some of that code is outdated it still seems to work fine. I get no JS errors in Firefox.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post

    Thumbs up

    Thanks for responding.

    It won't work in IE 6 and if I make the text longer the script stops working.

    I would like to put 3 lines of text for each message.




    Update:
    Problem has been solved.

    Thank you all.
    Last edited by rob86; 07-17-2007 at 04:05 AM. Reason: update


  •  

    Posting Permissions

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