正如标题所说,当我尝试将jplayer集成到我购买的文件管理器脚本中时,我遇到了这个错误。任何帮助,将不胜感激。 这是代码
$files_table[$rN["id"]] .= "<td>
<div id="jquery_jplayer"></div>
<!-- Using the cssSelectorAncestor option with the default cssSelector class names to enable control association of standard functions using built in features -->
<div id="jp_container" class="demo-container">
<ul>
<li><span>Select a track : </span></li>
<li><a href=""download.php?path=".$rr["path"]."\" class="track track-default">".$rr["title"]."</a></li>
</ul>
<p>
<span class="play-state"></span> :
<span class="track-name">nothing</span>
at <span class="extra-play-info"></span>
of <span class="jp-duration"></span>, which is
<span class="jp-current-time"></span>
</p>
<ul>
<li><a class="jp-play" href="#">Play</a></li>
<li><a class="jp-pause" href="#">Pause</a></li>
<li><a class="jp-stop" href="#">Stop</a></li>
</ul>
<ul>
<li>volume :</li>
<li><a class="jp-mute" href="#">Mute</a></li>
<li><a class="jp-unmute" href="#">Unmute</a></li>
<li> <a class="jp-volume-bar" href="#">|<---------->|</a></li>
<li><a class="jp-volume-max" href="#">Max</a></li>
</ul>
</div>
</td>";
错误到达第一个标记。
答案 0 :(得分:2)
这是如何有效的PHP:
"<td> <div id="jquery_jplayer"></div>"
当然,您的意思是以下之一:
// print the content of $jquery_jplayer variable, if it exists, inside the id.
"<td> <div id=\"".$jquery_jplayer."\"></div>"
// print the string "jquery_jplayer" - notice the quotes are escaped
"<td> <div id=\"jquery_jplayer\"></div>"
// print the content of the variable + escaping the quotes
"<td> <div id=\"$jquery_jplayer\"></div>"
答案 1 :(得分:0)
正如您可以通过stackoverflow代码视图中的颜色看到的那样,您没有转义双引号。
如果要在"
分隔的字符串中使用"
,则必须将其转义。然后它变成\"
答案 2 :(得分:0)
您有两个选择:
答案 3 :(得分:0)
很可能是带引号的错误....
假设$ files_table [$ rN ['id']]已经有一个值,因为你通过连接到该变量。=
如果$ files_table [$ rN ['id']]没有值,请删除=
前面的点$files_table[$rN['id']] .= '
<!-- Using the cssSelectorAncestor option with the default cssSelector class names to enable control association of standard functions using built in features -->
<div id="jp_container" class="demo-container">
<ul>
<li><span>Select a track : </span></li>
<li><a href="download.php?path='.$rr['path'].'" class="track track-default">'.$rr['title'].'</a></li>
</ul>
<p>
<span class="play-state"></span> :
<span class="track-name">nothing</span>
at <span class="extra-play-info"></span>
of <span class="jp-duration"></span>, which is
<span class="jp-current-time"></span>
</p>
<ul>
<li><a class="jp-play" href="#">Play</a></li>
<li><a class="jp-pause" href="#">Pause</a></li>
<li><a class="jp-stop" href="#">Stop</a></li>
</ul>
<ul>
<li>volume :</li>
<li><a class="jp-mute" href="#">Mute</a></li>
<li><a class="jp-unmute" href="#">Unmute</a></li>
<li> <a class="jp-volume-bar" href="#">|<---------->|</a></li>
<li><a class="jp-volume-max" href="#">Max</a></li>
</ul>
</div>
';