$(location).attr('href'); not working

后端 未结 6 1234
醉梦人生
醉梦人生 2021-01-28 23:22

I do not know why but I have problems with this code. The banner is displayed on every page although it has specified the attribute $(location).attr(\'href\') you can help me?:<

6条回答
  •  执念已碎
    2021-01-28 23:37

    ok, I made ​​the change in this way, but did not seem to work:

    $(document).ready(function() {
    var currentUrl = window.location.href;
    if(currentUrl == 'http://streamingdb.net/')  
    $('#bottombar').show(); 
    $("#bottombarClose").click(function() {
    $('#bottombar').hide();
    });
    });
    

    then I added a "display:none" to div#Bottombar and everything works. Thanks to all of your time.

提交回复
热议问题