Welcome Guest, Not a member yet? Register   Sign In
Views, JSON, and HTML
#1

[eluser]luster[/eluser]
I'm new to CodeIgniter and MVC. I'm having some trouble trying to figure out the best place to put a snippet of HTML. I know that the answer is probably in the View area. Here is the problem, sometimes I want the snippet of HTML to be called normally, but other times I need AJAX to call it and to return it as JSON. How do I accomplish this?

On my webpage I have a "Add" button. This calls the Ajax and should return with some JSON that contains the HTML and the ID of the HTML.

This seems like this should be a common thing that people want to do. How do I accomplish this?


Messages In This Thread
Views, JSON, and HTML - by El Forum - 11-09-2012, 11:41 AM
Views, JSON, and HTML - by El Forum - 11-09-2012, 03:06 PM
Views, JSON, and HTML - by El Forum - 11-09-2012, 03:58 PM
Views, JSON, and HTML - by El Forum - 11-09-2012, 04:01 PM
Views, JSON, and HTML - by El Forum - 11-09-2012, 05:14 PM
Views, JSON, and HTML - by El Forum - 11-09-2012, 08:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB