Unable to load Bootstrap tooltip via Ajax

Viewed 3306

i'm trying to load (via Ajax Call) a tooltip whose title is in HTML tags. In the first page load when it is loaded by the include_once function, the tooltip works fine, but not when i trigger the page load with Ajax Call. Here are my files :

loadTable.php

    <?php
        $content = "<a data-toggle='tooltip' data-html='true' title='<strong>ok</strong>'
<span class='glyphicon glyphicon-align-left'></span></a>";

        echo $content;
    ?>

mypage.php

<button type="button" class="btn btn-primary" onclick="loadPage()">Load</button>
<div id="tableData">
    <?php include_once('loadTable.php');?>
</div>

myjavascriptfile.js

function loadPage(){
    $.ajax({
        type: "POST",
        url: "loadTable.php",
        data:{
            cache: false,
            success: function(result){
                $("#tableData").html(result);
            }
        });
    }
}

NB: of course i have simplified the example at the extreme, just for understanding and simplicity purposes.

1 Answers
Related