Reply To: How to make “add friend” button functions like in members directory(no reload)
The add friend button contains an ajaxified url, a cookie, a nonce and some other stuff. By default, this button is intended to be on members directory and on the profile header.
Open /bp-friends/firends-widget.js to see how BP actually handle this.
If you absolutely need to have this button elsewhere, a custom page for example, you need to extend the original class witch is in bp-xprofile-loader.php:38 (BP 2.0.1)
Otherwise, any action on this added button will always return to the member profile page after a click and not reload like it does when in the member directory.
I’m not a developper so i can’t help you more.
Perhaps read here for better understanding of this button.