精华内容
下载资源
问答
  • js获取域名

    2018-01-05 12:06:02
    //获取域名 window.location.host; (带端口号) document.domain; (不带端口号) //获取页面完整地址 window.location.href;

    //获取域名
    window.location.host; (带端口号)
    document.domain; (不带端口号)

    //获取页面完整地址
    window.location.href;

    展开全文
  • JS获取域名

    2020-07-25 13:23:04
    我不记得了,我会给可用分20
  • js获取域名的方法

    2020-10-24 19:38:29
    主要介绍了js获取域名的方法,涉及[removed]中常见方法的使用技巧,需要的朋友可以参考下
  • 本文实例讲述了js获取域名的方法。分享给大家供大家参考。具体实现方法如下://获取域名var k_host = window.location.host;var k_host2 = document.domain;//获取页面完整地址var k_url = window.location.href;...

    本文实例讲述了js获取域名的方法。分享给大家供大家参考。具体实现方法如下:

    //获取域名

    var k_host = window.location.host;

    var k_host2 = document.domain;

    //获取页面完整地址

    var k_url = window.location.href;

    运行结果如下:

    k_host:www.jb51.net

    k_host2:www.jb51.net

    k_url:https://www.jb51.net/article/60420.htm

    补充:

    location.hostname 返回 web 主机的域名

    location.pathname 返回当前页面的路径和文件名

    location.port 返回 web 主机的端口 (80 或 443)

    location.protocol 返回所使用的 web 协议(http:// 或 https://)

    希望本文所述对大家的javascript程序设计有所帮助。

    展开全文
  • javascript 获取域名

    2012-06-11 15:23:17
    //获取域名 host = window.location.host; host2=document.domain; //获取页面完整地址 url = window.location.href; document.write("host="+host) document.write("host2="+host2) document.write(...
    <script language="javascript">
    //获取域名
    host = window.location.host;
    host2=document.domain; 
    
    //获取页面完整地址
    url = window.location.href;
    
    document.write("<br>host="+host)
    document.write("<br>host2="+host2)
    document.write("<br>url="+url)
    </script>

    展开全文
  • thisURL = document.URL;thisHREF = document.location.href;thisSLoc = self.location.href;thisDLoc = document.location;strwrite = "thisURL:[" + thisURL + "]"strwrite += "thisHREF:[" + thisHREF + "]"strwr...

    thisURL = document.URL;

    thisHREF = document.location.href;

    thisSLoc = self.location.href;

    thisDLoc = document.location;

    strwrite = "

    thisURL:[" + thisURL + "]"

    strwrite += "

    thisHREF:[" + thisHREF + "]"

    strwrite += "

    thisSLoc:[" + thisSLoc + "]"

    strwrite += "

    thisDLoc:[" + thisDLoc + "]"

    document.write( strwrite );

    thisDLoc = document.location;

    thisURL = document.URL;

    thisHREF = document.location.href;

    thisSLoc = self.location.href;

    thisTLoc = top.location.href;

    thisPLoc = parent.document.location;

    thisTHost = top.location.hostname;

    thisHost = location.hostname;

    strwrite = "

    thisTLoc:[" + thisTLoc + "]"

    strwrite += "

    thisPLoc:[" + thisPLoc + "]"

    strwrite += "

    thisTHost:[" + thisTHost + "]"

    strwrite += "

    thisHost:[" + thisHost + "]"

    document.write( strwrite );

    thisTLoc = top.location.href;

    thisPLoc = parent.document.location;

    thisTHost = top.location.hostname;

    thisHost = location.hostname;

    tmpHPage = thisHREF.split( "/" );

    thisHPage = tmpHPage[ tmpHPage.length-1 ];

    tmpUPage = thisURL.split( "/" );

    thisUPage = tmpUPage[ tmpUPage.length-1 ];

    strwrite = "

    thisHPage:[" + thisHPage + "]"

    strwrite += "

    thisUPage:[" + thisUPage + "]"

    document.write( strwrite );

    展开全文
  • 运行如下: thisDLoc = ... thisURL: [http://925bb.taobao.com/js/js获取url.html] thisHREF: [http://925bb.taobao.com/js/js获取url.html] thisSLoc: [http://925bb.taobao.com/js/js获取url.html] thisDLoc: ...
  • js取得当前url,javascript获取当前页面url值,js获取域名如果获取“当前”域名host = window.location.host; url=document.domain; url = window.location.href;取得完整url路径: 用以下代码可以完整研证结果: this...
  • var WshNetwork = new ActiveXObject("WScript.Network"); $("#spanusername").val(WshNetwork.UserName); $("#spandomain").val(WshNetwork.UserDomain);
  • js获取域名携带参数

    2017-11-21 09:46:56
    获取域名参数 function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r
  • <scriptlanguage="javascript"> //获取域名 host=window.location.host; host2=document.domain; //获取页面完整地址 url=window.location.href; document....
  • Js获取域名地址并截取

    千次阅读 2019-09-07 15:39:18
    $(document).ready(function () { var localhref = window.location.... //获取当前域名 var url = localhref.split('?')[0]; //以'?'为分割进行截取 [0]是网站域名,[1]是网站所带参数 var localarr = localhre...
  • //获取域名 var h= window.location.host; var d = document.domain; //获取页面完整地址 var url = window.location.href;
  • js获取域名:location.origin

    千次阅读 2019-11-22 11:09:47
    域名: location.origin 主要常用的代码: 主机、域名: location.host 锚点: location.hash 域名: location.origin 请求路径: location.pathname 端口: location.port 协议: location....
  • //获取域名 host = window.location.host; host2=document.domain; //获取页面完整地址 url = window.location.href; document.write("host="+host) document.write("host2="+host2) document.write("url="+url)
  • JS 获取域名等信息

    千次阅读 2013-03-07 09:44:38
    //获取域名 host = window.location.host; host2=document.domain; //获取页面完整地址 url = window.location.href; document.write(" host="+host) document.write(" host2="+host2) ...
  • js获取网站域名

    2019-04-23 16:42:02
    js获取网站域名

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 98,352
精华内容 39,340
关键字:

js获取域名