im trying pass value java-script function. when click link uncaught syntaxerror: unexpected identifier
here code
<?php include_once("php_includes/check_login_status.php"); $routehtml = ''; $sql = "select user,title route"; $query = mysqli_query($db_conx, $sql); while($row = mysqli_fetch_array($query, mysqli_assoc)) { $title = $row["title"]; $user = $row["user"]; $routehtml .= '<p>planned '.$user.'</p><a href="#" onclick="fetchdata('.$title.')" title="load map">'.$title.'</a><br />'; } ?> i echo $routehtml in div tag
you forgot add quotes javascript:
$routehtml .= '<p>planned '.$user.'</p><a href="#" onclick="fetchdata(\''.$title.'\')" title="load map">'.$title.'</a><br />';
Comments
Post a Comment