php - How to select most recent txt file from directory in javascript -
i want select modified file server using javascript.
this code in js files:
$.get('dropbox/geo/sites/gc_room/hassayampa.txt', function(data){ // split lines var lines = data.split('\n'); // iterate on lines , add together categories or series $.each(lines, function (lineno, line) { var items = line.split('\t'); if(lineno !== 0) { var x = + new date(items[0]), primout = parsefloat(items[3] / 10.0), secout = parsefloat(items[5] / 10.0); if(!isnan(primout) && !isnan(secout)){ options.series[0].data.push([x,primout]); options.series[1].data.push([x,secout]) } } }); new highcharts.chart(options); // in $.get callback function }); here coding index.php file views js files:
<body width="100%"> <script src="//ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.3.min.js"></script> <script src="https://geoinc.org/css/georemco/graph/highcharts.js"></script> <script src="https://geoinc.org/css/georemco/graph/exporting.js"></script> <script src="monitor/sitedata/data/lane_metals/graph/lane_metals.js" type="text/javascript"></script> <script src="monitor/sitedata/data/lane_metals/graph/loveland.js" type="text/javascript"></script> <script src="monitor/sitedata/data/lane_metals/graph/test.js" type="text/javascript"></script> <script src="monitor/sitedata/data/lane_metals/graph/apples.js" type="text/javascript"></script> <script src="monitor/sitedata/data/lane_metals/graph/example.js" type="text/javascript"></script> <script src="monitor/sitedata/data/lane_metals/graph/fruit.js" type="text/javascript"></script> <table border="0" cellspacing="5" cellpadding="0" width="10%" bgcolor="#e8e8e8"> <tr> <th><div id="test" style="width: 900px; height: 300px;"></div></th> <th><div id="example" style="width: 900px; height: 300px;"></div></th> </tr> <tr> <td><div id="lane_metals" style="width: 900px; height: 300px;"></div></td> <td><div id="fruit" style="width: 900px; height: 300px;"></div></td> </tr> <tr> <td><div id="loveland" style="width: 900px; height: 300px;"></div></td> <td><div id="apples" style="width: 900px; height: 300px;"></div></td> </tr> </table> </body> thanks 1 time again everyone!
your best solution have javascript request php application handles access dropbox.
from explained dropbox visible serverside , want expose txt files client side, solve current problem add together method, php side, handle file access dropbox , expose client side javascript can request contents php application.
javascript php
No comments:
Post a Comment