提问者:小点点

仅在单击popup modal ok或next jquery js后打开new选项卡


如何创建一个脚本,以打开一个标签href url在新的窗口或标签只有在点击ok按钮后,在弹出的模式boostrap。从这个意义上说,打开主页时,我点击弹出按钮'OK'出现的时候,我把登录的凭据是正确的。您可以在这里找到代码https://jsfidle.net/rptl5d28/4/

null

Login = {
    _autoload: [
 
        "popUpModalLogin"
    ],

 
    popUpModalLogin: function(){
        $(".button-row[name=login]").on("click", function(){
        $('.pop-outer').fadeIn('slow');
        });

        $("button.close").on("click", function(){
       $('.pop-outer').fadeOut('slow');
       });

    }

}

null

感谢你的帮助.


共1个答案

匿名用户

我将此添加到HTML代码中,然后弹出一个显示“Go to Login?”

  <a target="_blank" class="btn btn-black" href="http://google.com" onclick="return confirm('Go to Login?');">Login</a><br

null

<!DOCTYPE html>
<html lang="en">
<body>

<div id="login-header">
    <nav id="login-nav-bar" class="navigation">
        <div class=" site_container container-fluid">
            <div class="center_wrapper">
                <div class="row">
                    <div id="language-selector" class="col-md-2 col-xs-1">
                        <form id="lang_form_LangCurrencyComponent" class="lang-form" action="/yb2bacceleratorstorefront/en/_s/language" method="post"><div class="country-select">
            <label class="control-label" for="lang_selector_LangCurrencyComponent"></label>
            <select name="code" id="lang_selector_LangCurrencyComponent" class="overflowing lang-selector">
                <option value="en" selected="selected" lang="en">English</option></select>
        </div>
        <div>
<input type="hidden" name="CSRFToken" value="61625501-be46-49f6-8b96-b7a20d3eb376">
</div></form>
                    </div>     
            </div>
        </div>
    </div></nav>
</div>

<div class="row">
    <div class="login-page">
        <div class="kering_container login-section">
            <div class="center_wrapper" id="ke-main">

    <form id="login-wrap" action="/yb2bacceleratorstorefront/en/j_spring_security_check" method="post"><img class="login-logo" src="/yb2bacceleratorstorefront/_ui/responsive/common/images/kering-ew.svg">
        <div id="globalMessages">
            </div>

        <div class="text-input-wrap">
            <div class="form-group">
                <label class="control-label " for="j_username">
            </label>
            
        <input id="j_username" name="j_username" class="text-input form-control" placeholder="EMAIL" type="text" value=""></div>
        </div>
        <div class="text-input-wrap">
            <div class="form-group">
                <label class="control-label " for="password">
            </label>
        <input id="password" name="j_password" class="text-input" placeholder="PASSWORD" type="password" value="" autocomplete="off"></div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="wrap-input-check dark-check">
                    <input type="checkbox" class="input-check-credits" name="_spring_security_remember_me" id="j_remember" value="1">
                    <label id="remember-me" for="j_remember" class="login-remember check-credits">Remember me</label>
                </div>
            </div>
            <div class="col-md-6">
               <a href="#forgottenPwdModal" data-link="/login/pw/request" class="forgot password-forgotten" data-toggle="modal" data-backdrop="static" data-target="#forgottenPwdModal">Forgot your password?</a>
            </div>
        </div>

        <div class="button-row">
        </div>
        <a target="_blank" class="btn btn-black" href="http://google.com" onclick="return confirm('Go to Login?');">Login</a><br
        
        <a class="register" href="/yb2bacceleratorstorefront/en/register">Not registered yet? Request an account</a>
              <br><br>
        <hr class="top-separator">
        
    <div>
<input type="hidden" name="CSRFToken" value="61625501-be46-49f6-8b96-b7a20d3eb376">
</div></form><div class="modal fade" id="forgottenPwdModal" tabindex="-1" role="dialog" aria-labelledby="forgottenPwdModal" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered " role="document">
        <div class="modal-content">
            <div class="modal-body">
                <div id="forgottenPwdModal" class="forgottenPwd clearfix">
                    
                    


</div></div>
            </div>
        </div>
    </div>
</div>

</div>

</div>
    <div>
</div>

    <!-- Modal -->
<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">Modal Boostrap title</h4>
      </div>
      <div class="modal-body">
        <div class="pop-inner">
          <h2>Result of LOGIN: </h2>
          <p> Welcome to our first website. To go to Homepage, please click NEXT</p>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">NEXT</button>
      </div>
    </div>
  </div>
</div></div>



</body>
</html>