Javascript stockticker : not showing data on php page
<p>iam not getting any javascript errors , code is getting rendered properly only, but still server not displaying data on the page.
please check the code below .</p>

<pre><code> &lt;style type="text/css"&gt;
#marqueeborder {
    color: #cccccc;
    background-color: #EEF3E2;
    font-family:"Lucida Console", Monaco, monospace;
    position:relative;
    height:20px; 
    overflow:hidden;
    font-size: 0.7em;
}
#marqueecontent {
    position:absolute;
    left:0px;
    line-height:20px;
    white-space:nowrap;
}
.stockbox {
    margin:0 10px;
}
.stockbox a {
    color: #cccccc;
    text-decoration : underline;
}
&lt;/style&gt;

 &lt;/head&gt;

 &lt;body&gt;
  &lt;div id="marqueeborder" onmouseover="pxptick=0" onmouseout="pxptick=scrollspeed"&gt;
&lt;div id="marqueecontent"&gt;


&lt;?php

    // Original script by Walter Heitman Jr, first published on http://techblog.shanock.com

    // List your stocks here, separated by commas, no spaces, in the order you want them displayed:
    $stocks = "idt,iye,mill,pwer,spy,f,msft,x,sbux,sne,ge,dow,t";

    // Function to copy a stock quote CSV from Yahoo to the local cache. CSV contains symbol, price, and change
    function upsfile($stock) { copy("http://finance.yahoo.com/d/quotes.csv?s=$stock&amp;f=sl1c1&amp;e=.csv","stockcache/".$stock.".csv"); }

    foreach ( explode(",", $stocks) as $stock ) {

        // Where the stock quote info file should be...
        $local_file = "stockcache/".$stock.".csv";

        // ...if it exists. If not, download it.
        if (!file_exists($local_file)) { upsfile($stock); }
        // Else,If it's out-of-date by 15 mins (900 seconds) or more, update it.
        elseif (filemtime($local_file) &lt;= (time() - 900)) { upsfile($stock); }

        // Open the file, load our values into an array...
        $local_file = fopen ("stockcache/".$stock.".csv","r");
        $stock_info = fgetcsv ($local_file, 1000, ",");

        // ...format, and output them. I made the symbols into links to Yahoo's stock pages.
        echo "&lt;span class=\"stockbox\"&gt;&lt;a href=\"http://finance.yahoo.com/q?s=".$stock_info[0]."\"&gt;".$stock_info[0]."&lt;/a&gt; ".sprintf("%.2f",$stock_info[1])." &lt;span style=\"";
        // Green prices for up, red for down
        if ($stock_info[2]&gt;=0) { echo "color: #009900;\"&gt;&amp;uarr;";   }
        elseif ($stock_info[2]&lt;0) { echo "color: #ff0000;\"&gt;&amp;darr;"; }
        echo sprintf("%.2f",abs($stock_info[2]))."&lt;/span&gt;&lt;/span&gt;\n";
        // Done!
        fclose($local_file); 
    }
?&gt;
&lt;span class="stockbox" style="font-size:0.6em"&gt;Quotes from &lt;a href="http://finance.yahoo.com/"&gt;Yahoo Finance&lt;/a&gt;&lt;/span&gt;

&lt;/div&gt;
&lt;/div&gt;
 &lt;/body&gt;
 &lt;script type="text/javascript"&gt;

    // Original script by Walter Heitman Jr, first published on http://techblog.shanock.com

    // Set an initial scroll speed. This equates to the number of pixels shifted per tick
    var scrollspeed=2;
    var pxptick=scrollspeed;
var marqueediv='';
var contentwidth="";
var marqueewidth = "";
    function startmarquee(){
        alert("hi");
        // Make a shortcut referencing our div with the content we want to scroll
        marqueediv=document.getElementById("marqueecontent");
        //alert("marqueediv"+marqueediv);
        alert("hi"+marqueediv.innerHTML);

        // Get the total width of our available scroll area
         marqueewidth=document.getElementById("marqueeborder").offsetWidth;
        alert("marqueewidth"+marqueewidth);
        // Get the width of the content we want to scroll
         contentwidth=marqueediv.offsetWidth;
        alert("contentwidth"+contentwidth);
        // Start the ticker at 50 milliseconds per tick, adjust this to suit your preferences
        // Be warned, setting this lower has heavy impact on client-side CPU usage. Be gentle.
        var lefttime=setInterval("scrollmarquee()",50);
        alert("lefttime"+lefttime);
    }

    function scrollmarquee(){
        // Check position of the div, then shift it left by the set amount of pixels.

        if (parseInt(marqueediv.style.left)&gt;(contentwidth*(-1)))
            marqueediv.style.left=parseInt(marqueediv.style.left)-pxptick+"px";
        //alert("hikkk"+marqueediv.innerHTML);}
        // If it's at the end, move it back to the right.
        else{
            alert("marqueewidth"+marqueewidth);
            marqueediv.style.left=parseInt(marqueewidth)+"px";
        }
    }

    window.onload=startmarquee;

&lt;/script&gt;
&lt;/html&gt;
</code></pre>

<p>Below is the server displayed page.</p>

<p><img src="http://i.stack.imgur.com/KFO5W.png" alt="Stockticker"></p>

<p><img src="http://i.stack.imgur.com/QbGmA.png" alt="Updated StockTicker Image"></p>

<p>I have updated with screenshot with your suggestion, i made change in html too, to check what is showing by child dev</p>
