我试图将值传递给 java 脚本函数。但是当我点击链接时,我得到一个
Uncaught SyntaxError: Unexpected identifier
这是代码
<?php
include_once("php_includes/check_login_status.php");
$routeHTML = '';
$sql = "SELECT user,title FROM route";
$query = mysqli_query($db_conx, $sql);
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
$title = $row["title"];
$user = $row["user"];
$routeHTML .= '<p>Planned By '.$user.'</p><a href="#" onclick="fetchdata('.$title.')" title="Load This Map">'.$title.'</a><br />';
}
?>
我$routeHTML
在 div 标签中回显