I have looked for a while, but I can't find a solution for this. I want the following:

  • Open an URL inside a Bootstrap modal. I have this working off course. So the content is loaded dynamically.
  • When an user pushes a button inside this modal, I want the current modal to hide, and immediately after that, I want a new modal to open with the new URL (which the user clicked on). This content of the 2nd modal is also loaded dynamically.
  • 如果用户随后关闭第二个模式,第一个模式必须再次返回.

我已经盯着这个看了好几天了,希望有人能帮我.

提前谢谢您.

推荐答案

如果看不到具体的代码,就很难给出准确的答案.但是,从 bootstrap 文档中,可以像这样隐藏模式:

$('#myModal').modal('hide')

然后,在隐藏另一个模式后显示该模式:

$('#myModal').on('hidden.bs.modal', function () {
  // Load up a new modal...
  $('#myModalNew').modal('show')
})

您必须找到一种方法将URL推送到新的模式窗口,但我认为这不是什么大不了的事.如果不看代码,很难举例说明这一点.

Jquery相关问答推荐

使用 shell 脚本判断 json 数组响应是否具有特定用户名和状态的 jq 命令

使用 jQuery / javascript 测试链接是否是外部的?

在 Bootstrap 3 中向工具提示添加换行符

jQuery 滚动到 Div

Jquery .on('scroll')在滚动时不触发事件

如何使用Angular 检测浏览器后退按钮单击事件?

如何在 Jquery 中通过索引获取子元素?

如何禁用在div内单击

jQuery 序列化不注册复选框

如何在 jQuery 中修改序列化的表单数据?

jquery beforeunload 关闭(不离开)页面时?

blueimp 文件上传插件中的 maxFileSize 和 acceptFileTypes 不起作用.为什么?

验证外部脚本是否已加载

使用 jQuery 将宽度设置为百分比

jQuery XML 错误请求的资源上不存在‘Access-Control-Allow-Origin’标头.

使用 jQuery DataTables 时禁用第一列的自动排序

使用 jQuery 比较两个 Javascript 对象数组

在 bootstrap 弹出窗口中包含表单?

javascript,是否有像 isArray 这样的 isObject 函数?

如何在 jQuery 中取消绑定悬停?