location.href = '/m/';//So schreiben Sie den URL-Code der aktuellen Seite
一个字
一个字 2019-09-03 17:23:55
0
3
1355

<script type="text/javascript">

(function(){

    var sUserAgent = navigator.userAgent;

    if (sUserAgent.indexOf('Android') > -1 && sUserAgent.indexOf( 'Mobile') > -1 ||. sUserAgent.indexOf('iPod') > ||. sUserAgent.indexOf('Symbian') > -1 ||. sUserAgent.indexOf('IEMobile') > /m/';//如何写当前页面url代码

}

else

{

    }

})();

</script>

一个字
一个字

Antworte allen(1)
秋香姐家的小书童
//获取当前窗口的
Urlvar url = window.location.href;
//结果: 
获取当前窗口的主机名
var host = window.location.host;
//结果:
localhost:61768
//获取当前窗口的端口
var port = window.location.port;
//结果:61768
//获取当前窗口的路径
var pathname = window.location.pathname;
//结果:
/Home/Index
//获取当前文档的
Urlvar URL = document.URL;
//结果:
http://localhost:61768/Home/Index?id=2&age=18
//获取参数
var search = window.location.search;
//结果:
?id=2&age=18


  • Antwort 亲,不会写,求写
    一个字 Autor 2019-09-03 20:39:19
  • Antwort 还在么,
    一个字 Autor 2019-09-10 10:00:14
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!