代码之家  ›  专栏  ›  技术社区  ›  Chrissa

获取URL值以加载包含内容的弹出框

  •  0
  • Chrissa  · 技术社区  · 6 年前

    这是我的密码

    $(window).load(function(newSubscriber) {});
    
    function newSubscriber() {
        var URL = $(location).attr('href');
        var GET_ARR = URL.split('/');
        if ($.inArray('?subscriber=yes', GET_ARR)) {
    
            $("#list-builder").delay(delay).fadeIn("fast", () => {
                $("#popup-box").fadeIn("fast", () => {});
            });
            $("#popup-box-content").html("<p style='text-align: center'>Thank you for subscribing to our mailing list!</p>");
        }
    }
    

    操作.php

    if ($stmt -> execute()) {
        header("Location:index.php?subscriber=yes");
    }
    

    html文件

    <div id="list-builder"></div>
    <div id="popup-box">
        <img src="assets/images/close.png" id="popup-close" />
        <div id="popup-box-content">
        </div>
    </div>
    
    1 回复  |  直到 6 年前
        1
  •  0
  •   Chrissa    6 年前

    这些作品!

    $(window).on('load', function(){
     newSubscriber();
    });
    
    function newSubscriber(){
    var URL = $(location).attr('href');
     var GET_ARR = URL.split('?');
    
     if(GET_ARR[1] == 'subscriber=yes'){
    
        $("#popup-box").fadeIn("fast", () => {});
             $("#popup-box-content").html("<p style='text-align: center'>Thank you for subscribing to our mailing list!</p>");
    
              $("#popup-close").click(() => {
                $("#list-builder, #popup-box").hide();
              });
    
    }
    
    }