How to use current address url in jquery

This question already has an answer here:

  • Get the current URL with JavaScript? 18 answers

  • This has got to have been answered already, but have you tried.. console.log(window.location.href); ? var url = document.URL ? This isn't PHP, variables tend not to start with $


    您的脚本运行的页面的URL可以通过document.URL访问


    You don't need jQuery for this. In JavaScript, it's like this:

    var url = document.location;
    
    链接地址: http://www.djcxy.com/p/22544.html

    上一篇: 如何获取当前网址?

    下一篇: 如何在jQuery中使用当前的地址URL