For instance, in javascript: 1
<script>
var name = "<?php echo 'Adam'; ?>";
alert("The name is: " + name);
</script>
or 2
<script>
alert("The name is: <?php echo 'Adam'; ?>");
</script>
And in html? 1
<head>
<?php echo '<title>Page #1</title>'; ?>
</head>
or 2
<?php $page_number = "1"; ?> // on top of the script with the rest of the other X code. //
<!doctype html....
<html>
<head>
<title>Page #<?php echo $page_number; ?></title>
</head>
I'm not looking for the short, long, easy or hard method, I'm looking for the correct method to do this.
1 - In a professional way, how this should be done?
2 - What is your way/method to do this?
Thanks
Update: Also:
<input type="button" onclick="javascript:add_friend(0,<?php echo $profile_user_id; ?>);" />