Before someone has a go at me or marks this down, I have looked all over the internet to find out how to do this (including the same question on stackoverflow). I\'m new, an
Use jQuery
.In the HTML page -
<button type="button">Click Me</button>
<script>
$(document).ready(function() {
$("button").click(function(){
$.ajax({
url:"php_page.php", //the page containing php script
type: "POST", //request type
success:function(result){
alert(result);
}
});
});
})
</script>
Php page -
echo "Hello";