Get current URL with jQuery

创建日期: 2023-04-21 10:32 | 作者: 风波 | 浏览次数: 12 | 分类: 前端

来源:https://stackoverflow.com/questions/406192/get-current-url-with-jquery

var pathname = window.location.pathname; // Returns path only (/path/example.html)
var url      = window.location.href;     // Returns full URL (https://example.com/path/example.html)
var origin   = window.location.origin;   // Returns base URL (https://example.com)
12 浏览
0 评论