模态对话框打开时获取URL更改但我需要更改原始URL当我关闭模态时使用(jquery.history.js) [英] Got Url Changes When Modal Dialog Open But I Need To change Original url When I Close Modal using(jquery.history.js)

查看:66
本文介绍了模态对话框打开时获取URL更改但我需要更改原始URL当我关闭模态时使用(jquery.history.js)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<html>
<head>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jquery.history.js"></script>
</head>
<body>
  <a class="btn btn-primary" data-toggle="modal" href="" data-target="#myModal" onclick="dummyurl()">Click me</a>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-body">
      its modal content
      </div>
      </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script type="text/javascript">
 var dummyurl = (function (window, undefined) {
    History.pushState(null, null, "?ChangePassword");
});
 </script>
</body>
</html>







单击按钮后,打开带有虚拟URL的模态拨号盘

喜欢 forgetpassword.html?ChangePassword



但我需要回复 forgetpassword.html

当我关闭模态对话框并单击外部模态对话框时,它应该回到原始URL




After i click button, open modal dialop with dummy url
like forgetpassword.html?ChangePassword

but i need url back to forgetpassword.html
when i close modal dialog box and also click outside modal dialog ,it should back to original url

推荐答案

这篇关于模态对话框打开时获取URL更改但我需要更改原始URL当我关闭模态时使用(jquery.history.js)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆