When writing a modal box on the iframe subpage, according to the previous writing method, there was no response after clicking the button that pops up the modal box, but the code was not written incorrectly. The code is as follows:
<input class="btn" type="button" value="Delete post" onclick="deletePost()"/> <!-- Administrator sends message modal box 2017.1.25 --> <div class="modal fade" role="dialog" style="display:none"> <div class="modal-header" > <a class="close" data-dismiss="modal">×</a> <h3>Send a message to the poster</h3> </div> <div class="modal-body" > <h4 style="text-align:center;color:red" ></h4><br/> <h4 style="text-align:center">Please enter the message content:<input type="text" style="width:40%;height:15%" ></h4><br/> </div> <div class="modal-footer" > <a href="#" rel="external nofollow" rel="external nofollow" class="btn btn-success" onclick="callPostEditor()">Send</a> <a href="#" rel="external nofollow" rel="external nofollow" class="btn bt" onclick="reSet()">Reset</a> </div> </div>
I searched online for a long time but couldn't find the reason, but I saw a way to put the html code of the modal box on the parent page and use:
.$('#messageModal').modal('show');
To call the modal box display.
If the subpage has a js method called in the modal box, then the call is implemented through the following statement:
// Conframe is the name attribute of the iframe tag of the parent page (note: the id attribute cannot be used, the id attribute of the iframe cannot be obtained in Firefox)();
That is, "iframe's name attribute.windows. method name()".
The above method to implement modal boxes in the iFrame subpage is all the content I share with you. I hope you can give you a reference and I hope you can support me more.