none
Javascript Layer Object RRS feed

  • Question

  • Here are some code snippets from a project I am working on

    In a nutshell my code works under IE8 but not IE9

    I am sure there must be some include file I can add
    to the page of code I wrote that output text in the
    client window of IE8 that will do the same job under
    IE9 and all recent releases of the IE browser

    I think perhaps the function was renamed,  just don't
    understand my the development team at microsoft
    would reduce the reusability of successive IE browser
    with Javascipt ?






    ///// Layer Object Here

    function writeLine(lines, lineIdx){
       var layer = new LayerObject("writer");
       var line  = lines[lineIdx];
       var value;
       var tempWord;
       var i = 1;


    ////// Call to the writeLine Function Here

    // here is the javascript that does not work on IE9 works on IE8 (       
           layer.write(out);
          setTimeout("writeLine(lines,"+(lineIdx+1)+")", 500 );

    ///////  Full page of code here

    <?php
     
          include("../common/dbconnect.php");
          include("getDatabase.php");    
          include("stringParse.php");
          include("countWords.php");
          include("countPhrasesforfullPage.php");

       echo $enterMode;

         if($enterMode=="phrase")
         {
         include("createLayersMYSQL.php");  
         }
          else
         {
          include("createLayersMYSQLOrig.php");  
         }

         //  include("createLayersXML.php");  
         //include("calibrate.php");
          include("htmlHead.php");

          $query = mysql_query("select * from booksetting where itemnum = 1");
          $row = mysql_fetch_array($query);
          $speed = $row["displayspeed"];

          mysql_free_result($query);

          echo $speed;
          echo "<BR> ";
    ?>

    <SCRIPT language=javascript>
    <!--

    var lines = new Array();
    var i = 3;
    var wordHolder;
    var first= "$new[";
    var second = "];";   
    var $count = 3;

    function init(){
      writeLine(lines, 0);
     
    }


    function writeLine(lines, lineIdx){
       var layer = new LayerObject("writer");
       var line  = lines[lineIdx];
       var value;
       var tempWord;
       var i = 1;    
          
          if(line == null)
           {
            //getLogoffTime();
            window.location="index.php";
           
          <?
           if( $rememberLine < $showCount  )
            {
           ?>

           window.location="writePageXML.php";
           <?
            }
            else
            {
          ?>
            window.location="index.php";
          <?
            }
           
          ?>
          }

          if(line != null)
          {

         var myString ;
         myString = line;
     
        var index = myString.indexOf("[");
        var speed = myString.charAt(index+1);
        var speed2 = myString.charAt(index+2);
        var speed3 = myString.charAt(index+3);
      // speed = speed + speed2 + speed3;
       
       speed = parseFloat(speed);

       var index = myString.indexOf("]");
       var length = myString.charAt(index+1);
       var length2 = myString.charAt(index+2);

       if(length=="]")    {    length="";   }
       if(length=="[")    {    length="";   }
       if(length2=="]")   {    length2="";  }
       if(length2=="[")   {    length2="";  }
     
       length = length + length2;
        
      // if (length<=1){speed=1};

      <?
         include("calibrateLength.php");
      ?>
    var out =
    "<table width=90%><tr><td><font  size=5> "+ line + " " +
    length +  " " + speed + " </font></td></tr></table>" ;
    //"<table width=90%><tr><td><font  size=5> "+ line + " </font></td>
    //</tr></table>" ;
     


    // here is the javascript that does not work on IE9 works on IE8 (       
           layer.write(out);
          setTimeout("writeLine(lines,"+(lineIdx+1)+")", 500 );


    //    setTimeout("writeLine(lines,"+(lineIdx+1)+")", speed );
     
    //setTimeout("writeLine(lines,"+(lineIdx+1)+")",<? echo $speed; ?>);
    //setTimeout("writeLine(lines,"+(lineIdx+1)+")",12);
        
         
          }
    }




    <?





         include("layers.txt");
         include("htmlFoot.php");

    ?>

    Friday, June 15, 2018 6:03 AM