Welcome Guest, Not a member yet? Register   Sign In
Ajax tabs
#1

[eluser]crumpet[/eluser]
Hi, I am trying to create a product view page with tabs for comments, related products, etc. I want these tabs to load through ajax when you click the buttons. My first instinct was to have ajax post to a seperate function for each tab and have that function reply with a view file which the js displays. I can't seem to get this to work with json.
Code:
$return['view'] = $this->load->view('front/modules/resources/resource_view/additional/comments');
echo json_encode($return);
ends up as this :
Code:
{"view":null}whats up
where "whats up" is what is in the view file. I'm guessing this is becuase its to big. Is there a way around this or is the best practise to have php only send the variables and make js format the data into a view.

Thanks


Messages In This Thread
Ajax tabs - by El Forum - 10-13-2008, 03:30 PM
Ajax tabs - by El Forum - 10-13-2008, 03:51 PM
Ajax tabs - by El Forum - 10-13-2008, 04:01 PM
Ajax tabs - by El Forum - 10-13-2008, 04:21 PM
Ajax tabs - by El Forum - 10-13-2008, 07:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB