Welcome Guest, Not a member yet? Register   Sign In
Returning view partials using AJAX and JSON
#2

[eluser]Randy Casburn[/eluser]
Hi Matt,

There are numerous ways...and accompanying opinions ;-)

If the HTML exists in view partials, load the view partials into a variable as you normally would:

Code:
$big = $this->load->view('HTML FOR big_image DIV',TRUE);
$thumbs = $this->load->view('HTML FOR item_image_thumbs DIV',TRUE);

$aPartials = array('partials'=>array('big_image'=>$big,'item_image_thumbs'=>$thumbs));

echo json_encode($aPartials);

and there you have it.

Randy


Messages In This Thread
Returning view partials using AJAX and JSON - by El Forum - 08-20-2008, 05:03 PM
Returning view partials using AJAX and JSON - by El Forum - 08-20-2008, 06:09 PM
Returning view partials using AJAX and JSON - by El Forum - 08-20-2008, 06:12 PM
Returning view partials using AJAX and JSON - by El Forum - 08-20-2008, 07:24 PM
Returning view partials using AJAX and JSON - by El Forum - 08-20-2008, 07:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB