I have a php page that I want to get output HTML with AJAX. Here's my Ajax code.
& lt; Script & gt; $ (Function () {$ (".load_product_gallery"). ("Click", function () {$ .ajax ({url: 'product_gallery_popup.php', // source cache: false, // make sure The result is not cached success: function (data) {$ ('. Product_gallery_popup_container_2') .html (data);}});});}); & Lt; / Script & gt; The output of the PHP page should be HTML to
My php page: Will this return the php page output content in HTML to ajax? data .
Ob_start (); // Start the buffering content / * php page content * / $ html = ob_get_clean (); // buffer buffer content and buffering return $ HAL;
No comments:
Post a Comment