I want to pass php image url as javascript function parameter.
Please let me know how can I do this.
<html>
<?php
$image=$row['image'];
$img=$loc.'user/'.$image;
?>
<script type=text/javascript>
function demo()
{
some code here;
}
</script>
<body>
<button type="submit" onclick=demo(<?php echo $img?>) >
</body>
</html>
In javascript I am doing some editing work on image .
How can I pass this php variable (i.e. image url as javascript function parameter)