如何调用函数broadcast_js文件

时间:2018-07-03 03:45:20

标签: javascript php

我已经有一个php脚本。当我调用其函数时,该函数未运行。如何调用函数?这是脚本

 ...........
                    <table class="table table-hover" width="100%">
                        <thead style="position: sticky;top: 0;">
                            <tr>
                                <th style="position: sticky;left:-5px;background-color: white">Level</th>
                                <th>Area</th>
                                <?php
                                while($row=mysql_fetch_array($max_date))
                                { echo '<th>'.$row['date'].'</th>'; }
                                ?>
                                <th>MOM</th>
                                <th>YOY</th>
                                <th>YTD</th>
                                <th>Con Check</th>
                                <th>Target</th>
                                <th>Achievement</th>
                            </tr>
                        </thead>
                        <tbody  id="table-payload"></tbody>
                    </table>............

    <?php

      $modul_js = array();
      $modul_js = [
                    "page/broadcast/broadcast_js.js"
                  ];
    ?>

更新 这是我的mysql呼叫查询的js文件

    $.getJSON("page/broadcast/query_broadcast.php?case=payload",function(data){
    $.each(data.item, function(i, v) {
        $('#table-payload').append(
                '<tr class="pointer">'+
                    '<td>'+v.level+'</td>'+
                    '<td>'+v.area+'</td>'+
                    '<td>'+v.mtd+'</td>'+
                    '<td>'+v.mom+'%</td>'+
                    '<td>'+v.yoy+'%</td>'+
                    '<td>'+v.ytd+'%</td>'+
                    '<td>'+v.dev+'</td>'+
                    '<td>'+v.pt+'</td>'+
                    '<td>'+v.achiev+'%</td>'+
                '</tr>'
                 );
    })
});

1 个答案:

答案 0 :(得分:1)

替换

<?php

  $modul_js = array();
  $modul_js = [
                "page/broadcast/broadcast_js.js"
              ];
?>

<script type="text/javascript" src="page/broadcast/broadcast_js.js"></script>