我试图加载“远程”内容,基本上是通过HTTP请求(在同一站点上)发送的信息。返回的内容本身抛出回的信息,如:Twitter Bootstrap模式 - 加载“远程”内容
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">× </button>
<h3>Change Your Password</h3>
</div>
<div class="modal-body">
<form>
<fieldset>
<label>Your current password</label>
<input type="password" placeholder="password">
<label>Confirm current password</label>
<input type="text" placeholder="password">
<button type="submit" class="btn">Submit</button>
</fieldset>
</form>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>
</div>
然而,对于模式对话框,显示远程内容,我认为我应该显示已经modal-body
类:
<div class="modal fade hide" id="ajax">
<div class="modal-body">
<p>body content to be replaced</p>
</div>
</div>
怎么办我绕过这一步,并提供完整的模态div内容,并使其正确显示?
请注意,通过AJAX将页面加载到模式中,因此受到“相同原点策略”限制(即:您将无法将awesomesite.com加载到托管在myapp.com上的div中) 。 –
是否意味着通过href返回的响应应该是AJAX响应?或者我们可以从同一个应用程序获得一些其他页面。 – Mutant
@mutant:对不起,我不认为我理解你的问题。 –