Json-to-HTML-Table icon indicating copy to clipboard operation
Json-to-HTML-Table copied to clipboard

Using the library in code

Open pre2612 opened this issue 12 years ago • 1 comments

<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <script type="text/javascript" src="jsontohtml.js"></script>
    </head>
    <body>

        <div> 
            <?php

           // echo $jsonResult;
              error_reporting(E_ALL);
             ini_set("display_errors", 1);
             include 'include/weather_data.php';
             include 'include/getJson.php';
            $jsonValue = new getjson();
            $table = 'WEATHER_SIMPLE_FORECAST';
             $jsonResult = $jsonValue->getJsonData($table);
            print_r($jsonResult);

            ?>

            <script type="text/javascript">
                var jsonHtmlTable = ConvertJsonToTable(eval([$jsonResult]), 'jsonTable', null, 'Download');
                document.write(jsonHtmlTable);
            </script>

       </div>
    </body>
</html>

Could you please tell me why is it not displaying anything?

Thanks

pre2612 avatar Dec 28 '12 16:12 pre2612

Please check these items:

  1. Are you try to use some developer tools (e.g. Firebug) to see the jsonHtmlTable variable?
  2. Could you please post your data here?

Cheers

afshinm avatar Dec 29 '12 15:12 afshinm