Calling PHP Titles inside Javascript Markup

First, don’t echo your php, but assemble everything in a string, let’s say $titlestring.

Next, make this string available for access by the javascript (the slug is the one you used to register the script):

$params = array (
    'titlestring'   =>  $titlestring,
    );
wp_localize_script ('your-script-slug', 'IframeTitle', $params);

Finally, access the variable in the script:

'<div class="title">' + IframeTitle.titlestring + '</div>' +