简体   繁体   中英

load external page in bootstrap modal box

I have a link like this

echo "<a href=\"profile.php?name=".$row['name']."\">".$profile."</a>";

And I have another page

<?php
    $profile = $_GET['name'];
    echo $profile;
?>

Now what I want is when user click on that link bootstrap modal box will open that another page. How can I do that? Please help!

尝试在模态框中使用iframe,并在iframe src中传递您的网址。

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

<a id="testing" href="http://fb.com/">Hye</a>

<iframe id="frame" src=""></iframe>
<script>
$(document).ready(function(){
    $("#testing").click(function(e){
        e.preventDefault()
        var link = $("#testing").attr("href")
        $("#frame").attr("src",link);

    })

})
</script>

This will change link on click on a tag. But still you can check bootstrap js for opening modal :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM