Right now I'm using below script for button click which opens in new window
<script>function myFunction()
{
window.open("ouput.php");
}
</script>
But what I need is when user clicks button the results from output.php must be appended in the same window at the bottom.
How to execute PHP file using Ajax?
I'm using this code with jQuery but there is no result:
$.get( "out.php",
function( data ) {
document.write(data.Molecule);
$( "output" ).html("Molecule: "+data.Molecule );
alert( "Load was performed." );
},
"json" );
});
});
How to run an external PHP file, get results and display it in the same webpage?