亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在服務器上調用 PHP 函數但在本地服務器上工作時找不到 JS 函數

在服務器上調用 PHP 函數但在本地服務器上工作時找不到 JS 函數

慕沐林林 2022-07-21 21:10:06
如標題中所述,我的代碼在本地工作,但不在服務器上。更準確地說,當我調用任何 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>
查看完整描述

1 回答

?
Cats萌萌

TA貢獻1805條經驗 獲得超9個贊

對于那些有同樣問題的人來說,我正在使用的服務器與我在本地工作的服務器沒有相同的 PHP 版本。

在本地和服務器上嘗試 phpinfo() 以檢查您的 PHP 版本是否相同。


查看完整回答
反對 回復 2022-07-21
  • 1 回答
  • 0 關注
  • 97 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號