我有一个内容页面,其中包含以下代码,其中显示了Internet Explorer中的Bootstrap Modal弹出窗口,但未在Firefox中显示。我的引导程序参考文件位于母版页中。
<script type="text/javascript">
function openModal() {
$('#adverts').modal('show');
}
</script>
<!-- Modal Popup Ads-->
<div runat="server" class="modal fade" id="adverts" tabindex="-1" role="dialog" aria-labelledby="memberModalLabel" aria-hidden="true" clientidmode="Static" >
<div class="modal-dialog" style="padding:1px; top:15%">
<div class="modal-content" style="width:580px;">
<div style="height:10px; margin-right:10px; margin-top:3px;">
<button type="button" class="close" data-dismiss="modal" title="Close">×</button>
</div>
<div class="modal-body" >
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
<asp:SqlDataSource ID="SqlDataSource6" runat="server"
ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT id, message FROM users_html_notify WHERE (id = 1)"></asp:SqlDataSource>
</div>
</div>
</div>
</div>
<!-- Modal Popup Ads -->
背后的VB.NET代码
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "Pop", "openModal();", True)
End Sub
注意:上面的代码在网页加载上的Internet Explorer中运行良好,但在Firefox中不起作用