#1
  1. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    4
    Rep Power
    0

    JavaScript not working...


    Hi,

    I am new to this board, but I know quite a lot about HTML, JavaScript, PERL and PHP coding.

    I have a JavaScript problem with a page that I am working on.

    I am trying to use a JavaScript fading effect from DynamicDrive, called Dynamic Fader.

    I have followed the instructions and inserted it into my code but its not working. I tried at least 15 other JavaScript effects and since none of them worked in my browser (IE6), I came to a conclusion that JavaScript is not working in my code.

    I have an index.php page, with HTML, JS, and PHP coding in it.

    The below code is taken from my index.php page:

    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>REGs Clan Sponsored by PSH and FNF</TITLE>

    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    <META CONTENT="REGs Clan" name=classification>
    <META CONTENT="FireWire" name=Author>
    <META CONTENT="Layout is Copyright  [url]http://www.regsclan.com[/url]" name=copyright>
    <META CONTENT="REGs Clan, REGs, Clan, REGs Clan CS, CS, Counter-Strike, Gaming Clan, CS Gaming, PSH, FNF, ProjectSafeHouse" name=keywords>
    <META CONTENT="CS Gaming Clan" name=description>

    <LINK REL="STYLESHEET" HREF="css/regs.css" type="text/css">
    <LINK REL="SHORTCUT ICON" HREF="images/favicon.ico">

    <SCRIPT SRC="css/fade.js" LANGUAGE="JavaScript"></SCRIPT>

    <SCRIPT LANGUAGE="JavaScript">
    <!--

    function SymError()
    {
      return true;
    }

    window.onerror = SymError;

    var SymRealWinOpen = window.open;

    function SymWinOpen(url, name, attributes)
    {
      return (new Object());
    }

    window.open = SymWinOpen;

    //-->
    </SCRIPT>

    <style TYPE="text/css">
        <!--
        .TextScrollStyle {
            visibility:hidden;
            font-family:Verdana;
            font-weight:bold;
            text-align:center;
            padding:0;
            margin:0;
            width:100%;
            overflow:hidden;
        }

        -->
        </style>
        
    <SCRIPT LANGUAGE="JavaScript1.2">

    //1) Configure messages:
            var TS_message = new Array();
                 TS_message[0] = '<div align="left">Welcome to REGs Clan!</div>';
               TS_message[1] = '<div align="left">"The Elite Gaming Community"</div>';
            TS_message[2] = '<div align="left">Latest News</div>';

    //2) Configure fader width and colors:
        var TS_scrollwidth=400               // Configure fader width
            var TS_colorFG = 0x000000;             // Text color
            var TS_colorBG = 0xFFFFFF;           // bgColor

                 // uncomment any value you wanted to change
            //var TS_ymax    = 50;            // How many pixel to move
            //var TS_ystep   = 1;              // 1 or -1 only (Scroll direction)
            //var TS_speed   = 2;              // The smaller the value the faster
            //var TS_pause   = 100;            // Pause time(milisecond) between messages
            var TS_fadestep= 20;              // Steps to fade in and out

                 if (document.all)
                 document.write('<style>#containerarea{width:'+TS_scrollwidth+'}</style>')
    </SCRIPT>
    </HEAD>

    <BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 text="#000040" background="images/index_bg.gif">

    .
    .
    .
    .
    .
    (I removed some extra code)
    .
    .
    .
    .
    .
    .
    .
    .
                <!--Copyright Info-->
                <br>
                <CENTER><IMG SRC="images/copyright.png" border="0"></CENTER>
                
        <!--End Navigation-->
          
              <br>
          </font></TD>
        <TD background="images/index_08.gif">&nbsp; </TD>
        <TD height="456" valign="top" background="images/index_09.gif"> 
            <CENTER>
              <BR>
                <DIV id="containerarea">
                <SCRIPT LANGUAGE="JavaScript1.2" SRC="textfader.js"></SCRIPT>
                </DIV>
                            
                <BR>
                <DIV align="center"><font face="Verdana" size="1" color="#7E9DB1">
                . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
                </font>
                </DIV>
                <BR>
                
            <!--Insert News Manager Here-->
            
          <?PHP
        
    include("cutenews/show_news.php");
            
    ?> 
            
            <!--End News Manager-->
            
                 <DIV align="center"><font face="Verdana" size="1" color="#7E9DB1">
                . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
                </font>
                </DIV>
                <BR>
                
            </CENTER>
          </TD>
      </TR>
      <TR> 
        <TD valign="top"><img src="images/spacer.gif" width="106" height="1"></TD>
        <TD><img src="images/spacer.gif" width="9" height="1"></TD>
        <TD><img src="images/spacer.gif" width="665" height="1"></TD>
        <TD><img src="images/spacer.gif" width="10" height="1"></TD>
      </TR>
    </TABLE>
    </BODY>
    </HTML>
    The code I am trying to make to work is:

    PHP Code:
    <style TYPE="text/css">
        <!--
        .
    TextScrollStyle {
            
    visibility:hidden;
            
    font-family:Verdana;
            
    font-weight:bold;
            
    text-align:center;
            
    padding:0;
            
    margin:0;
            
    width:100%;
            
    overflow:hidden;
        }

        -->
        </
    style>
    <
    script language="JavaScript1.2">

    /*
    Dynamic Fader Script (updated: 00/08/05)
    Created and submitted by Nicholas Poh (hwinmain@yahoo.com) to Dynamicdrive.com
    Key modifications by Dynamic Drive for stability/ efficiency in NS
    For full source code, usage terms, and 100s more scripts, visit [url]http://dynamicdrive.com[/url]
    */

    //1) Configure messages:
            
    var TS_message = new Array();
                 
    TS_message[0] = '<div align="left">Hello there</div>';
               
    TS_message[1] = '<div align="left">Wow... hope you like it!</div>';
            
    TS_message[2] = '<div align="left">Presented by <A HREF="http://dynamicdrive.com">Dynamicdrive.com</A></div>';

    //2) Configure fader width and colors:
                 
    var TS_scrollwidth=400      //configure fader width
            
    var TS_colorFG 0x000000;    // Text color
            
    var TS_colorBG 0xFFFFFF;  //bgColor

                 // uncomment any value you wanted to change
            //var TS_ymax    = 50;            // How many pixel to move
            //var TS_ystep   = 1;            // 1 or -1 only (Scroll direction)
            //var TS_speed   = 2;            // The smaller the value the faster
            //var TS_pause   = 100;            // Pause time(milisecond) between messages
            
    var TS_fadestep20;            // Steps to fade in and out

                 
    if (document.all)
                 
    document.write('<style>#containerarea{width:'+TS_scrollwidth+'}</style>')
    </script> 
    and

    PHP Code:
    <DIV id="containerarea">
    <
    SCRIPT LANGUAGE="JavaScript1.2" SRC="textfader.js"></SCRIPT>
    </DIV> 
    Would anyone happen to know what is wrong in my code that is preventing JavaScript from functioning?

    Your help will be greatly appreciated.

    Thank you,
    - FireWire
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    21
    Rep Power
    0
    If you are using XP - check that Javascript is enabled - as it comes, as default, deactivated....
  4. #3
  5. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    4
    Rep Power
    0
    Hey, thanks for your reply. I fixed the problem myself now. It was an entry in one of my SQL tables which was denying the execution of dynamic content.

IMN logo majestic logo threadwatch logo seochat tools logo