如标题中所述,我的代码在本地工作,但不在服务器上。更准确地说,当我调用任何 PHP 函数时,它找不到我的 JS 函数。
总结一下:这里的目标是从通过从数据库中检索数据创建的 HTML 表中生成一个 excel (.XLS) 文件。我的 Wamp 服务器在本地一切正常,但是当我将它移动到服务器时,调用 JS 函数 getDashboardResumeJ () 时出现此错误:
DashboardResume.php:124 Uncaught ReferenceError: getDashboardResumeJ is not defined
如果我删除主文件中的所有 PHP,则在服务器上一切正常。
主文件中的 PHP:
<button id="buttonXLS" href="#" onclick="exportTableToExcel('tableRecap', 'Rapport Mensuel <?php echo $year . '/' . $month?>')">Export to Excel</button>
<table style="display:none" id="tableRecap" >
<tr>
<td style="font-weight: bold">Nom et prénom</td>
<?php $arrayId = array(selectTableEmploye('nom', 'prenom')); ?>
</tr>
<tr>
<td style="font-weight: bold">Date d'entrée</td>
<?php selectTableEmploye('date_embauche'); ?>
</tr>
<tr>
<td style="font-weight: bold">Date de sortie</td>
<?php selectTableEmploye('date_depart'); ?>
</tr>
<tr>
<td style="font-weight: bold">Remarque 1</td>
<?php selectTableTimesheet('commentaire1',$arrayId,$month,$year); ?>
</tr>
<tr>
<td style="font-weight: bold">Remarque 2</td>
<?php selectTableTimesheet('commentaire2',$arrayId,$month,$year); ?>
</tr>
<tr>
<td style="font-weight: bold">Remarque 3</td>
<?php selectTableTimesheet('commentaire3',$arrayId,$month,$year); ?>
</tr>
<tr>
<td style="font-weight: bold">Remarque 4</td>
<?php selectTableTimesheet('commentaire4',$arrayId,$month,$year); ?>
</tr>
<?php
generateDays($dateMonth, $dateYear);
?>
</table>
Cats萌萌
相关分类