Thursday, 15 September 2011

jquery - output buffering and a php page and ajax -


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  

data .

My php page:

  Ob_start (); // Start the buffering content / * php page content * / $ html = ob_get_clean (); // buffer buffer content and buffering return $ HAL;  

Will this return the php page output content in HTML to ajax?


No comments:

Post a Comment