Suppose there is a dynamic HTML creation in PHP like the below:
php code
foreach( $content as $obj ){
$displayString .= "<a href='' onclick='return func($obj)'> View Details </a>";
}
echo $displayString;
JSON
$content
being an array of JSON objects
Javascript function:
func()
is a javascript function
How to pass PHP object values into a Javascript function and allow the javascript function parse through an object to display values?