Bootstrap modal frame Remote loading Web page method
This method is given in the Bootsrap modal box document:
Using link mode
<a data-toggle= "modal" href= "tieniu.php" data-target= "#modal" >click me</a>
Using script mode:
$ ("#modal"). Modal ({ "tieniu.php"});
No instances are given, and there are some details that are not explained in this usage. If you just copy and use it, that's no effect.
Many friends in the online problem this problem, most people in the copy and paste, they did not verify, on the chaos reply, alas!
The following is the code for the correct modal box remote Load method
Client code
<a data-toggle= "modal" href= "tieniu.php" data-target= "#modal" >click me</a><div class= "modal" id= " Modal "> <div class=" Modal-dialog "> <div class=" Modal-content "> <!-- Here is a remote loaded content area- </div> </div> </div>
Server-side code , the service-side code needs to contain a portion of the modal box text, please note
<?php $rnd =rand (1000,9999);? ><div class = "Modal-header" > <button type= "button" class = "Close" data-dismiss= "modal" aria-hidden= "true" >×</button> class = "Modal-title" >modal titleclass = "Modal-body" > <?php echo $rnd ;? ></div><div class = "Modal-footer" > <button type= "button" Span style= "color: #0000ff;" >class = "btn Btn-default" data-dismiss= "modal" >Close</button> <button type= "button" class = "btn btn-primary" >save changes</button></div>
Close modal box, call remote page again, but content does not refresh
Here's how to fix it
$ (document). Ready (function () { $(function() { $(this). Removedata ("Bs.modal");} )
Bootstrap mode box remote loading Web page is handled correctly