Erich Niemand Erich Niemand - 1 year ago 44
HTML Question

$.get() fails to update div


$.get("<?php PROCESS_PATH; ?>create_detail_cashbook_HTML.php");
return false;

HTML markup:

<div class="controls">
<button name="generate" type='button' id="generate" class="btn btn-primary"
onClick="">Generate Report</button>
<div id="report">

Ok so jQuery is meant to call PHP process from server and then the php which is working needs to print a report in the report divs.....

I have tried so many things now and I am just not getting this. Sorry guys I am new to all this and I know this is probably a simple problem with a simple solution.

Answer Source

What you are looking for is .load(), also the code needs to be placed under dom ready handler

jQuery(function ($) {
    $("#generate").click(function () {
        $('#report').load('<?php PROCESS_PATH; ?>create_detail_cashbook_HTML.php')