var url = window.location.href; //获取当前窗口的Url; 结果:http://localhost:61768/Home/Index?id=2&age=18 var host = window.location.host; //获取当前窗口的主机名; 结果:localhost:61768 var port = window.location.port; //获取当前窗口的端口; 结果:61768 var pathname = window.location.pat…