js 知识点

2018-01-26  本文已影响7人  洞房花猪
跳转
window.location.href="/Products/products/scl/"+scl+"/type/"+type;
获取自定义属性
type = $(this).attr("data-type");
获取网站域名
<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>
//以下为输出内容

host=www.shop.net
host2=www.shop.net
url=http://www.shop.net/test.php
上一篇 下一篇

猜你喜欢

热点阅读