Trying for a few days to do this and do not know why it does not work.
I want to run a php file using js. And using the event button onclick. Thanks for help
file.php
<?php
echo"<script>alert(\"good\");</script>";
?>
file.html
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function () {
$('#jabutton').bind('dblclick', function(){
$.get('file.php', function(){
alert('work good');
});
});
});
</script>
</head>
<body>
<?php
//this don't work and I don't know what change, I have to use"echo"
echo "<script><button onclick=\"jabutton\">Run</button></script>";
?>
</body>
</html>