以下の2か所でエラーが出ており、調べてもわからなかったのでご教示ください。
<?php 省略 $strHTML = '<!DOCTYPE html> <html> 省略 $(document).ready(function() {$('.demo').tbodyScroll({thead_height: '30px',tbody_height: '100px',head_bgcolor: 'transparent',foot_bgcolor: 'transparent'}); }); 省略 </html> '; $output = array ( 'total_page' => ceil($datanum / $page_disp_kensu), 'text' => ($strHTML) ); echo json_encode($output); ?>
①$(document).ready(function() {$('.demo').tbodyScroll({thead_height: '30px',tbody_height: '100px',head_bgcolor: 'transparent',foot_bgcolor: 'transparent'}); });でsyntax error, unexpected '(', expecting T_VARIABLE or '$'というエラーが出ます。
②一番下の</html> ';でsyntax error, unexpected '<'というエラーが出ます。
「追記」
最新のソースです。現状は
$strHTML = <<<'eof'<table id="tbl_list" cellspacing="0" cellpadding="0">
の箇所で以下のエラーが出ています。
以下のコードそのままでエラーが出ますが、どこに問題があるのでしょうか?
「syntax error, unexpected T_SL」
$strHTML = <<<'eof' <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="description" content="テスト"> <title>tbodyScroll - jQueryプラグイン</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script src="jquery.tbodyscroll.js"></script> <script> $(document).ready(function() { $(".demo").tbodyScroll({thead_height:"30px",tbody_height:"100px",head_bgcolor: "transparent",foot_bgcolor: "transparent"}); }); </script> <style> th,td {width: 180px;} </style> </head> eof; //ヘッダー部 $strHTML = <<<'eof'<table id="tbl_list" cellspacing="0" cellpadding="0"> <thead> <tr> <th scope="col" class="f-weight">備品<br>タイプ</th> <th scope="col" class="f-weight"><a href="#" id="sort" name="keisokuki" param="'._hs($sort_keisokuki_img).'">備品名</a></th> </tr> </thead> eof; $strHTML .= <<<'eof'<tbody > eof; if ($datanum > 0) { while ($CN->EOF() == true) { $strHTML .= <<<'eof'<tr ".$bgcolor."> <td class='break'>"._hs($CN->GetFieldData('mes_type'))."</td> <td class='break'>"._hs($CN->GetFieldData('mes_name'))."</td> </tr> eof; $CN->MoveNext(); } } else { $strHTML .= <<<'eof'<tr><td colspan='28'>該当するデータがありません。</td></tr> eof; } $CN->DBClose(); $strHTML .= <<<'eof' </tbody> </table> </html> eof; $output = array ( 'total_page' => ceil($datanum / $page_disp_kensu), 'text' => ($strHTML) ); echo json_encode($output); ?>
回答4件
あなたの回答
tips
プレビュー