简体   繁体   English

如何使用锚标记href打开代码的详细信息数据?

[英]How I can use anchor tag href to open details data for my code?

I am trying to open details data obtained from php-mysql in a model box instead of a new html page. 我试图在模型框中而不是新的html页中打开从php-mysql获取的详细数据。 Currently it is opening in other html page but I want to add that in a model box. 目前它正在其他HTML页面中打开,但我想在模型框中添加它。

Here is my current code: 这是我当前的代码:

<a class="btn btn-info"  href="details.php?view_id=<?php echo $row['userID']; ?>" title="click for Details" onclick="details.php"><span class="glyphicon glyphicon-eye-open"></span> Show Details</a> 

here it refers to details.php?view_id but model example found with id selector like bellow, 在这里它指的是details.php?view_id,但是找到了带有ID选择器(例如波纹管)的模型示例

<a href="#openModal">Show Details</a>
  <div id="openModal" class="modalDialog">
               <a href="#close" title="Close" class="close">X</a>
                <div>
                    <a href="#close" title="Close" class="close">X</a>
                    <h2>Modal Box</h2>

                </div>
            </div> 

How I can add href="details.php?view_id=" instead of #openModel ?? 如何添加href =“ details.php?view_id =”而不是#openModel

I am new learner, please help. 我是新手,请帮忙。

 function edit_m_id(str){ var xhttp; document.getElementById("edit_con_tent").innerHTML = "<center>loading.......</center>"; xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("edit_con_tent").innerHTML = this.responseText; } }; xhttp.open("GET", "edit_m_con.php?q="+str, true); xhttp.send(); } 
 <a href="#small-modal" onclick="edit_m_id('<?php echo $id_rand;?>')" data-toggle="modal">Edit</a> <div id="small-modal" class="modal fade" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Modal Header</h4> </div> <div class="modal-body"> <span id='edit_con_tent'></span> <p>Some text in the modal.</p> </div> <div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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