var pathname = window.location.pathname; // Returns path only
var url      = window.location.href;     // Returns full URL
第一个只能找到路径
第二个返回的url