IM正确实施confimation窗口和IM有点搞不清triyng正确实施modal(确认窗口)。如何使用jQuery,HTML和使用Twitter的引导框架Twitter的引导框架
的事情是,此刻我的网站呈现一个带有链接的表格,ammong各个环节有一个“删除按钮”,当用户点击它,他们去到另一个页面请求确认,该按钮确认只是像delete.php?ref=THE-LINK
这样的链接。字符串THE-LINK是,以确定要删除的内容链接的jQuery刚刚获得通过的唯一的ID:
$('.remove_link').live('click', function(e) { window.location = 'delete.php?ref=' + $(this).attr('id'); });
好了,现在我不希望用户从表页转到删除页面,我想使用模态。 Twitter的模式运作非常简单,只需包括HTML的格式和JavaScript:$('#modal-from-dom').modal('show');
:
<script src="JS/jquery-1.7.min.js"></script>
<script src="JS/bootstrap-modal.js"></script>
<div id="modal-from-dom" class="modal hide fade">
<div class="modal-header">
<a href="#" class="close">×</a>
<h3>Delete URL</h3>
</div>
<div class="modal-body">
<p>You are about to delete one track url, this procedure is irreversible.</p>
<p>Do you want to proceed?</p>
</div>
<div class="modal-footer">
<a href="delete.php?confirm=yes&ref=THE-URL" class="btn danger">Yes</a>
<a href="#" class="btn secondary">No</a>
</div>
</div>
然后,你可以仅仅通过火起来。关键是,我怎么能ID THE-URL传递到模式,以使其动态,因为在这一点上的模态问我对两个选项(链接,是或否),但链接必须是动态,具有取决于删除按钮($(#remove_link).attr('id')
)谁把它的ID的改变。那我该如何做这项工作?谢谢你的帮助!