未捕获的SyntaxError:

The code should make a pop up window, asking for confirmation "press ok to confirm the action for user" but it doesn't. i'm all out of ideas.

function friendToggle(type,user,elem){
var conf = confirm("Press OK to confirm the '"+type+"' action for user 
<?php echo $u; ?>.");
if(conf != true){
    return false;
}
$(elem).innerHTML = 'please wait ...';
var ajax = ajaxObj("POST", "php_parsers/friend_system.php");
ajax.onreadystatechange = function() {
    if(ajaxReturn(ajax) == true) {
        if(ajax.responseText == "friend_request_sent"){
            $(elem).innerHTML = 'OK Friend Request Sent';
        } else if(ajax.responseText == "unfriend_ok"){
            $(elem).innerHTML = '<button onclick="friendToggle(\'friend\',\'<?php echo $u; ?>\',\'friendBtn\')">Request As Friend</button>';
        } else {
            alert(ajax.responseText);
            $(elem).innerHTML = 'Try again later';
        }
    }
}
ajax.send("type="+type+"&user="+user);
}
</script>

PHP code:

<?php 
$friend_button = '<button disabled>Request As Friend</button>';
$block_button = '<button disabled>Block User</button>';
// LOGIC FOR FRIEND BUTTON
if($isFriend == true){
    $friend_button = '<button onclick="friendToggle(\'unfriend\',\''.$u.'\',\'friendBtn\')">Unfriend</button>';
}
 else if($user_ok == true && $u != $log_username && 
$ownerBlockViewer == false){
    $friend_button = '<button onclick="friendToggle(\'friend\',\''.$u.'\',\'friendBtn\')">Request As Friend</button>';
}
// LOGIC FOR BLOCK BUTTON
if($viewerBlockOwner == true){
    $block_button = '<button onclick="blockToggle(\'unblock\',\''.$u.'\',\'blockBtn\')">Unblock User</button>';
} else if($user_ok == true && $u != $log_username){
    $block_button = '<button onclick="blockToggle(\'block\',\''.$u.'\',\'blockBtn\')">Block User</button>';
}
?> 

Opening up the console i see "Uncaught SyntaxError: Invalid or unexpected token"

The console issue is with lines 2 & 3 of your JavaScript code;

var conf = confirm("Press OK to confirm the '"+type+"' action for user
<?php echo $u; ?>.");

You have a multi-line String which the console is not interpreting as one String value. In order to resolve, ECMAScript 6 (ES6) introduced template literals which can be utilized like below to handle multi-line Strings;

var conf = confirm(`Press OK to confirm the '"+type+"' action for user
<?php echo $u; ?>.`);

(i.e. use back-ticks rather than double quotes to start & end the multi-line String)

Or, if ES6 isn't supported you can use good old String concatenation like below;

var conf = confirm("Press OK to confirm the '"+type+"' action for user" +
"<?php echo $u; ?>.");