-1

how i can put this code

<?php echo "user"; ?>

inside this function

$(function() {
    $('#my-tooltip').tooltipster({
        interactive: true,
        content: 'Loading...',
        contentCloning: false,
        contentAsHTML: true,
        contentAsPHP: true,
        animation: 'fade',
        functionBefore: function(origin, continueTooltip) {
            // we'll make this function asynchronous and allow the tooltip to go ahead and show the loading notification while fetching our data.
            continueTooltip();
            origin.tooltipster('content', 
            '<div class="hovercard"> \n\
            <div> \n\
            <div class="display-pic"> \n\
            <div class="cover-photo"> \n\
            <div class="display-pic-gradient"></div>\n\
            <img src="img/NY.jpg" style="width:370px;height:200px;"> </div>\n\
            <div class="profile-pic"><div class="pic"> \n\
            <span class="chat-img">\n\
            <a href="#"><img src="image/19068919.54b2108777ce0.png" alt="User Avatar" class="img-circle" style="width:98px;height:98px;"></a>\n\
            </span></div>\n\
            <div class="details"> <ul class="details-list"> \n\
            </div></div></div><div class="display-pic-gradient"></div>\n\
            <div class="title-container"> \n\
            <a href="#">Tamil Selvan</a> \n\
            <p class="other-info">   PUT PHP CODE HERE      </p></div>\n\
            <div class="info"><div class="info-inner"> <div class="interactions"> <a href="#" class="btn"><i class="fa fa-user-plus"></i> Add Friend</a> <a href="#" class="btn"><i class="fa fa-user-plus"></i> Add Friend</a> \n\
            <a href="#" class="btn">Follow</a> </div></div></div></div></div>');
        }
    });
});

i want to place the php code inside the content of this function but i don't know how someone can help me

Klaus
  • 1
  • 1

1 Answers1

0

you can do one thing if your above function and php code both are in same file then by putting below code at the place of PUT PHP CODE HERE.

   <?php echo "user"; ?>

but if not in same file then only one option is make ajax call on server and return code in response and paste there.

Vishal Patel
  • 1,715
  • 16
  • 26