1<script type="text/javascript">
2 var php_var = "<?php echo $php_var; ?>";
3</script>
1// Most effective way to call a javascript function with parameter of PHP variable
2echo '<input type="button" value="Button" onclick="return openEditor(\'' . $path_image . '\')">';