Load created php file data via ajax

Ive been trying to do this for a long time here…
First of all, im working with Buddypress latest ver. under WP latest ver.

What i want to do, is i want to understand how to call content within a php file via ajax. I know php is server side, so doing something like this:

Read More
$(#handle).click( function(){
$(#box).load('help.php' #content);
});

will only bring forth html within the document.But I have functions I need within, like let’s say for example a user’s avatar:

<?php bp_loggedin_user_avatar()?>

The returned content will stop at the function called. Will I have to create pages for all of the php files that I want to call content from? Or, require the file to retrieve the content?

I’ve looked at some of the $ajax Jquery uses around here, but I ‘m not sure which one to implement.

I want to load certain content wrapped in specific divs in that php file. Basically, I just need help retrieving content that contains php lol.

Any ideas?

Related posts

Leave a Reply

1 comment