我正在使用 Twitter Bootstrap 模式窗口。以防模式窗口由于 js 错误而无法工作 - 有一个后备页面。如果模态窗口未加载,我如何确保页面已加载?
打开模态窗口的链接
<a href="#login-modal" data-toggle="modal" data-target="#login-modal">Login</a>
模态窗口
<!-- Login Modal -->
<div id="login-modal" class="modal hide fade landing-modal" tabindex="-2" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h3>Login</h3>
</div>
<div class="modal-body">
<form>
<div class="control-group">
<label for="email">Email Address</label>
<div class="controls">
<input class="input-medium" name="email" type="text" />
</div>
</div>
<div class="control-group">
<label for="password">Password</label>
<div class="controls">
<input class="input-medium" name="password" type="password" />
</div>
</div>
<div class="control-group">
<label class="checkbox">
<input type="checkbox" value="">
Remember me</label>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="button">
Login
</button>
</div>
</div>
</form>
</div>
</div>
当我尝试将链接添加到 href 时,如下所示
<a href="login.html" data-toggle="modal" data-target="#login-modal">Login</a>
模态窗口中的链接页面加载!!