一次性显示会话中的模式窗口
One time show modal window in session
我只需要在第一次登录网站时显示一次模式窗口(引导程序)。我为什么不能那样做?
模式窗口
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Przeczytaj zanim zaczniesz!</h4>
</div>
<div class="modal-body">
..........................
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
JS-
$(window).load(function () {
$('#myModal').modal('show');
});
简单地从服务器端在jsp中嵌入一个变量(idk是否使用框架);
request.setAttribute("isLoginPage", true);
并且假设您将jstl与jsp一起使用;
<script>
<c:if test="${isLoginPage}">
// your js code here
</c:if>
</script>
您可以使用这里回答的java来获得相同的结果。
或者只使用javascript,或者您可以使用获取当前url;
var url = window.location.href;
并检查url是否为登录url。然而,这种方法在单页应用程序中不起作用。
相关文章:
- Angular$scope在模式窗口内不起作用
- 更改不在引导模式窗口中工作的月份和年份
- TinyMCE全屏不允许出现模式窗口
- 自动模式窗口?/欢迎弹出框
- 推特Boostrap模式窗口-可拖动不工作
- Twitter Boostrap:模式窗口在重新播放模式窗口后不播放视频
- 在Bootstrap模式窗口中打开远程内容
- jQuery模式窗口在内容为“”时不居中;注入“;在飞行中
- 如何在模式窗口弹出窗口中隐藏滚动条
- fancybox将内容更改为模式窗口
- 将值传递给模式窗口中的 JavaScript 函数
- HTML 瞬态模式窗口
- 具有 UI 引导模式窗口的父$scope子
- 如何将参数传递到 UI 路由器状态的模式窗口
- 如何使用引导程序创建模式窗口
- j查询模式窗口,刷新父问题
- 无法将引导模式窗口作为路由打开
- 如何使模式窗口打开动态内容并更改url
- 在引导模式窗口内路由
- 更新面板和模式窗口