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

后端 未结 6 1370
醉梦人生
醉梦人生 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:42

    Try using var currentUrl = window.location.href instead. This will return the location of the current page.

提交回复
热议问题